From e4ab02107486c66145554e8c6bee95e536029100 Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Wed, 16 Dec 2020 21:10:37 +0100 Subject: [PATCH] bug fix bikeEvent.related resolver fixed --- src/datasources/db/participantAPI.ts | 1 - src/resolvers/cargoBikeResolver.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/datasources/db/participantAPI.ts b/src/datasources/db/participantAPI.ts index ce01f09..bd16bcf 100644 --- a/src/datasources/db/participantAPI.ts +++ b/src/datasources/db/participantAPI.ts @@ -25,7 +25,6 @@ import { Participant } from '../../model/Participant'; import { EngagementType } from '../../model/EngagementType'; import { ActionLogger, DBUtils, genDateRange, LockUtils } from './utils'; import { UserInputError } from 'apollo-server-express'; -import { GraphQLError } from 'graphql'; import { ResourceLockedError } from '../../errors/ResourceLockedError'; export class ParticipantAPI extends DataSource { diff --git a/src/resolvers/cargoBikeResolver.ts b/src/resolvers/cargoBikeResolver.ts index e6e067e..0d56bb9 100644 --- a/src/resolvers/cargoBikeResolver.ts +++ b/src/resolvers/cargoBikeResolver.ts @@ -215,7 +215,7 @@ export default { }, related (parent: any, __: any, { dataSources, req }: { dataSources: any, req: any }) { if (req.permissions.includes(Permission.ReadParticipant)) { - return dataSources.cargoBikeAPI.relatedByBikeEventId(parent.workshopTypeId); + return dataSources.cargoBikeAPI.relatedByBikeEventId(parent.id); } else { throw new PermissionError(); }