Skip to content

Commit

Permalink
Fix relation import
Browse files Browse the repository at this point in the history
  • Loading branch information
farreldarian committed Dec 24, 2023
1 parent 13f01b5 commit 3744da7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/generator/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ generatorHandler({
v.useVar('helpers'),
v.object(
relationalFields.map((field) => {
const varName = camelCase(pluralize(field.type))
const model = pluralize(field.type)
const varName = camelCase(model)
relations.add(varName)

addImport(`./${kebabCase(name)}`, name)
addImport(`./${kebabCase(model)}`, varName)

return [
field.name,
Expand Down

0 comments on commit 3744da7

Please sign in to comment.