remove apollo log plugin hack, improve model

This commit is contained in:
Moriz Wahl 2022-03-10 18:00:47 +01:00
parent fae9d91004
commit 80650e60b8
2 changed files with 5 additions and 8 deletions

View File

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

View File

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