From 38e2ab02301ebd314873216fef7b4074de972e4c Mon Sep 17 00:00:00 2001 From: Jam Risser Date: Mon, 11 Feb 2019 20:44:45 -0600 Subject: [PATCH] feat(repository): finished has-many-through unit test --- .../repositories/has-many-through-repository-factory.unit.ts | 2 +- .../src/relations/has-many/has-many-through.repository.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/repository/src/__tests__/unit/repositories/has-many-through-repository-factory.unit.ts b/packages/repository/src/__tests__/unit/repositories/has-many-through-repository-factory.unit.ts index 4209c4cf29bd..42455febf1bb 100644 --- a/packages/repository/src/__tests__/unit/repositories/has-many-through-repository-factory.unit.ts +++ b/packages/repository/src/__tests__/unit/repositories/has-many-through-repository-factory.unit.ts @@ -80,7 +80,7 @@ describe('createHasManyThroughRepositoryFactory', () => { Getter.fromValue(customerRepo), Getter.fromValue(orderRepo), ), - ).to.throw(/target model Customer is missing.*foreign key companyId/); + ).to.throw(/through model Customer is missing.*foreign key companyId/); }); /*------------- HELPERS ---------------*/ diff --git a/packages/repository/src/relations/has-many/has-many-through.repository.ts b/packages/repository/src/relations/has-many/has-many-through.repository.ts index 6d368fda9333..724f850be686 100644 --- a/packages/repository/src/relations/has-many/has-many-through.repository.ts +++ b/packages/repository/src/relations/has-many/has-many-through.repository.ts @@ -22,11 +22,13 @@ export interface HasManyThroughRepository { * Create a target model instance * @param targetModelData The target model data * @param options Options for the operation + * @param throughOptions Options passed to create through * @returns A promise which resolves to the newly created target model instance */ create( targetModelData: DataObject, options?: Options, + throughOptions?: Options, ): Promise; /** * Find target model instance(s)