bikeEvent.related resolver fixed
pull/35/head
leonnicolas 4 years ago
parent bf1c057763
commit e4ab021074
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -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 {

@ -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();
}

Loading…
Cancel
Save