From e6e8651c52e865db0e1c386f9f5ee88cbf705f4c Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Thu, 10 Dec 2020 14:51:40 +0100 Subject: [PATCH] bugs --- Dockerfile | 1 - src/resolvers/cargoBikeResolver.ts | 2 +- src/resolvers/participantResolvers.ts | 6 +++++- src/schema/type-defs.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7e451f..4ed180b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ FROM node:14.14.0-alpine3.10 AS builder -RUN npm --version WORKDIR / COPY ./src /src diff --git a/src/resolvers/cargoBikeResolver.ts b/src/resolvers/cargoBikeResolver.ts index d008537..ac788aa 100644 --- a/src/resolvers/cargoBikeResolver.ts +++ b/src/resolvers/cargoBikeResolver.ts @@ -51,7 +51,7 @@ export default { throw new PermissionError(); } }, - bikeEventTypeByd: (_:any, { id }: { id: number }, { dataSources, req }: { dataSources: any, req: any }) => { + bikeEventTypeById: (_:any, { id }: { id: number }, { dataSources, req }: { dataSources: any, req: any }) => { if (req.permissions.includes(Permission.ReadBikeEvent)) { return dataSources.cargoBikeAPI.bikeEventTypeById(id); } else { diff --git a/src/resolvers/participantResolvers.ts b/src/resolvers/participantResolvers.ts index f79b572..7dc5854 100644 --- a/src/resolvers/participantResolvers.ts +++ b/src/resolvers/participantResolvers.ts @@ -25,7 +25,7 @@ export default { Query: { participantById: (_: any, { id }: { id: any }, { dataSources, req }: { dataSources: any, req: any }) => { if (req.permissions.includes(Permission.ReadParticipant)) { - return dataSources.participantAPI.getParticipantById(id); + return dataSources.participantAPI.participantById(id); } else { throw new PermissionError(); } @@ -119,6 +119,10 @@ export default { isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }), isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req }) }, + EngagementType: { + isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }), + isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req }) + }, Mutation: { createParticipant: (_: any, { participant }: { participant: any }, { dataSources, req }: { dataSources: any, req: any }) => { if (req.permissions.includes(Permission.WriteParticipant)) { diff --git a/src/schema/type-defs.ts b/src/schema/type-defs.ts index 8c426df..6b25839 100644 --- a/src/schema/type-defs.ts +++ b/src/schema/type-defs.ts @@ -1058,7 +1058,7 @@ export default gql` persons(offset: Int, limit: Int): [Person!] "If offset or limit is not provided, both values are ignored" bikeEventTypes(offset: Int, limit: Int): [BikeEventType!] - bikeEventTypeByd(id: ID!): BikeEventType + bikeEventTypeById(id: ID!): BikeEventType "If offset or limit is not provided, both values are ignored" bikeEvents(offset: Int, limit: Int): [BikeEvent!]! bikeEventById(id:ID!): BikeEvent