Skip to content

Commit

Permalink
feat(repository): hasManyThrough - fix
Browse files Browse the repository at this point in the history
  • Loading branch information
derdeka committed Mar 2, 2020
1 parent e1b89b7 commit 9bd8f60
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/repository/src/repositories/legacy-juggler-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ import {
BelongsToDefinition,
createBelongsToAccessor,
createHasManyRepositoryFactory,
createHasManyThroughRepositoryFactory,
createHasOneRepositoryFactory,
HasManyDefinition,
HasManyRepositoryFactory,
HasManyThroughDefinition,
HasManyThroughRepositoryFactory,
HasOneDefinition,
HasOneRepositoryFactory,
includeRelatedModels,
InclusionResolver,
HasManyThroughDefinition,
HasManyThroughRepositoryFactory,
createHasManyThroughRepositoryFactory,
} from '../relations';
import {IsolationLevel, Transaction} from '../transaction';
import {isTypeResolver, resolveType} from '../type-resolver';
Expand Down Expand Up @@ -269,7 +269,8 @@ export class DefaultCrudRepository<
TargetEntiy extends Entity,
TargetID,
ThroughEntity extends Entity,
ThroughID
ThroughID,
ForeignKeyType
>(
relationName: string,
targetRepositoryGetter: Getter<EntityCrudRepository<TargetEntiy, TargetID>>,
Expand All @@ -280,14 +281,15 @@ export class DefaultCrudRepository<
TargetEntiy,
TargetID,
ThroughEntity,
ThroughID
ForeignKeyType
> {
const meta = this.entityClass.definition.relations[relationName];
return createHasManyThroughRepositoryFactory<
TargetEntiy,
TargetID,
ThroughEntity,
ThroughID
ThroughID,
ForeignKeyType
>(
meta as HasManyThroughDefinition,
targetRepositoryGetter,
Expand Down

0 comments on commit 9bd8f60

Please sign in to comment.