Skip to content

Commit

Permalink
createMany: Remove unnecessary "resolvedCount" computation
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Feb 4, 2021
1 parent dd66f31 commit 575c1eb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ function createModelApi<
if ('__type' in propDeclaration) {
const isManyOfRelationType =
propDeclaration.__type === RelationKind.ManyOf
const resolvedCount = isManyOfRelationType
? (count as number)
: 1
const relationalModel = factory[propDeclaration.modelName]
const records = isManyOfRelationType
? relationalModel.createMany(resolvedCount)
? relationalModel.createMany(count as number)
: relationalModel.create()

acc[key] = records
Expand Down

0 comments on commit 575c1eb

Please sign in to comment.