diff --git a/backend/src/graphql/model/DisbursementLink.ts b/backend/src/graphql/model/DisbursementLink.ts index e09efb83f..a578a4d62 100644 --- a/backend/src/graphql/model/DisbursementLink.ts +++ b/backend/src/graphql/model/DisbursementLink.ts @@ -1,5 +1,5 @@ import { Decimal } from 'decimal.js-light' -import { ObjectType, Field, Int } from 'type-graphql' +import { ObjectType, Field } from 'type-graphql' import { DisbursementJwtPayloadType } from '@/auth/jwt/payloadtypes/DisbursementJwtPayloadType' @@ -27,7 +27,7 @@ export class DisbursementLink { this.memo = disbursementPayload.memo this.code = disbursementPayload.redeemcode if (disbursementPayload.exp) { - this.validUntil = disbursementPayload.exp * 1000 + this.validUntil = new Date(disbursementPayload.exp * 1000) } } @@ -52,6 +52,6 @@ export class DisbursementLink { @Field(() => String) code: string - @Field(() => Int) - validUntil: number + @Field(() => Date) + validUntil: Date } diff --git a/frontend/src/pages/TransactionLink.vue b/frontend/src/pages/TransactionLink.vue index 4e422a330..8b46a6326 100644 --- a/frontend/src/pages/TransactionLink.vue +++ b/frontend/src/pages/TransactionLink.vue @@ -104,8 +104,8 @@ const tokenExpiresInSeconds = computed(() => { const validLink = computed(() => { console.log('TransactionLink.validLink... linkData.value.validUntil=', linkData.value.validUntil) - console.log('TransactionLink.validLink... new Date().getTime()=', new Date().getTime()) - return new Date(linkData.value.validUntil) > new Date() + console.log('TransactionLink.validLink... new Date()=', new Date()) + return linkData.value.validUntil > new Date() }) const itemType = computed(() => { @@ -113,7 +113,7 @@ const itemType = computed(() => { console.log('TransactionLink.itemType... TEXT_DELETED') return 'TEXT_DELETED' } - if (new Date(linkData.value.validUntil) < new Date()) { + if (linkData.value.validUntil < new Date()) { console.log('TransactionLink.itemType... TEXT_EXPIRED') return 'TEXT_EXPIRED' } @@ -165,7 +165,7 @@ function updateRedeemedBoxText(type) { break case 'TEXT_EXPIRED': redeemedBoxText.value = t('gdd_per_link.link-expired', { - date: d(new Date(linkData.value.validUntil), 'long'), + date: d(linkData.value.validUntil, 'long'), }) break case 'TEXT_REDEEMED':