From 80650e60b81a23840f87569529e2d38496f7dbb3 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 10 Mar 2022 18:00:47 +0100 Subject: [PATCH] remove apollo log plugin hack, improve model --- backend/src/graphql/model/TransactionLink.ts | 9 ++++----- backend/src/server/plugins.ts | 4 +--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/src/graphql/model/TransactionLink.ts b/backend/src/graphql/model/TransactionLink.ts index a87d4a68a..f41d34acc 100644 --- a/backend/src/graphql/model/TransactionLink.ts +++ b/backend/src/graphql/model/TransactionLink.ts @@ -5,7 +5,7 @@ import { User } from './User' @ObjectType() export class TransactionLink { - constructor(transactionLink: dbTransactionLink, user: User) { + constructor(transactionLink: dbTransactionLink, user: User, redeemedBy: User | null = null) { this.id = transactionLink.id this.user = user this.amount = transactionLink.amount @@ -15,10 +15,9 @@ export class TransactionLink { this.createdAt = transactionLink.createdAt this.validUntil = transactionLink.validUntil this.showEmail = transactionLink.showEmail - // Type 'Date | null | undefined' is not assignable to type 'Date | null'. - this.deletedAt = null // transactionLink.deletedAt - this.redeemedAt = null // transactionLink.redeemedAt - this.redeemedBy = null // transactionLink.redeemedBy + this.deletedAt = transactionLink.deletedAt + this.redeemedAt = transactionLink.redeemedAt + this.redeemedBy = redeemedBy } @Field(() => Number) diff --git a/backend/src/server/plugins.ts b/backend/src/server/plugins.ts index 8d21178f3..a407135ea 100644 --- a/backend/src/server/plugins.ts +++ b/backend/src/server/plugins.ts @@ -40,8 +40,6 @@ const apolloLogPlugin = ApolloLogPlugin({ }) const plugins = - process.env.NODE_ENV === 'development' || process.env.NODE_ENV === '"development"' - ? [setHeadersPlugin] - : [setHeadersPlugin, apolloLogPlugin] + process.env.NODE_ENV === 'development' ? [setHeadersPlugin] : [setHeadersPlugin, apolloLogPlugin] export default plugins