diff --git a/backend/src/graphql/model/DisbursementLink.ts b/backend/src/graphql/model/DisbursementLink.ts index acbc584c9..87167d79a 100644 --- a/backend/src/graphql/model/DisbursementLink.ts +++ b/backend/src/graphql/model/DisbursementLink.ts @@ -10,34 +10,36 @@ import { User } from './User' export class DisbursementLink { constructor( disbursementPayload: DisbursementJwtPayloadType, + senderCommunity: Community, + senderUser: User, recipientCommunity: Community, recipientUser?: User, ) { + this.senderCommunity = senderCommunity this.recipientCommunity = recipientCommunity + this.senderUser = senderUser if (recipientUser !== undefined) { this.recipientUser = recipientUser } else { this.recipientUser = null } - this.senderGradidoID = disbursementPayload.sendergradidoid - this.senderName = disbursementPayload.sendername this.amount = new Decimal(disbursementPayload.amount) this.memo = disbursementPayload.memo this.code = disbursementPayload.redeemcode } + @Field(() => Community) + senderCommunity: Community + + @Field(() => User) + senderUser: User + @Field(() => Community) recipientCommunity: Community @Field(() => User, { nullable: true }) recipientUser: User | null - @Field(() => String) - senderGradidoID: string - - @Field(() => String) - senderName: string - @Field(() => Decimal) amount: Decimal diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.ts b/backend/src/graphql/resolver/TransactionLinkResolver.ts index 68a385e47..0eee2c991 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.ts @@ -249,7 +249,16 @@ export class TransactionLinkResolver { ) const homeCommunity = await getHomeCommunity() const recipientCommunity = new Community(homeCommunity) - const disbursementLink = new DisbursementLink(verifiedPayload, recipientCommunity) + const senderCommunity = new Community(senderCom) + const senderUser = new User(null) + senderUser.gradidoID = verifiedPayload.sendergradidoid + senderUser.firstName = verifiedPayload.sendername + const disbursementLink = new DisbursementLink( + verifiedPayload, + senderCommunity, + senderUser, + recipientCommunity, + ) logger.debug( 'TransactionLinkResolver.queryTransactionLink... disbursementLink=', disbursementLink, diff --git a/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue b/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue index 4b6e857aa..0f9ae50a9 100644 --- a/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue +++ b/frontend/src/components/LinkInformations/RedeemCommunitySelection.vue @@ -31,8 +31,8 @@ -