diff --git a/backend/src/graphql/model/TransactionLink.ts b/backend/src/graphql/model/TransactionLink.ts index f0134470a..652545bbd 100644 --- a/backend/src/graphql/model/TransactionLink.ts +++ b/backend/src/graphql/model/TransactionLink.ts @@ -12,12 +12,13 @@ export class TransactionLink { this.amount = transactionLink.amount this.holdAvailableAmount = transactionLink.holdAvailableAmount this.memo = transactionLink.memo - this.code = CONFIG.COMMUNITY_URL + 'redeem/' + transactionLink.code + this.code = transactionLink.code this.createdAt = transactionLink.createdAt this.validUntil = transactionLink.validUntil this.deletedAt = transactionLink.deletedAt this.redeemedAt = transactionLink.redeemedAt this.redeemedBy = redeemedBy + this.link = CONFIG.COMMUNITY_REDEEM_URL + this.code } @Field(() => Number) @@ -52,6 +53,9 @@ export class TransactionLink { @Field(() => User, { nullable: true }) redeemedBy: User | null + + @Field(() => String) + link: string } @ObjectType() diff --git a/frontend/src/components/ClipboardCopy.vue b/frontend/src/components/ClipboardCopy.vue index 67461cb0f..ddc2cde8e 100644 --- a/frontend/src/components/ClipboardCopy.vue +++ b/frontend/src/components/ClipboardCopy.vue @@ -14,11 +14,11 @@ export default { name: 'ClipboardCopy', props: { - code: { type: String, required: true }, + link: { type: String, required: true }, }, data() { return { - url: `${this.code}`, + url: `${this.link}`, } }, methods: { diff --git a/frontend/src/components/GddSend/TransactionResultLink.vue b/frontend/src/components/GddSend/TransactionResultLink.vue index 66b5529d6..79369fc99 100644 --- a/frontend/src/components/GddSend/TransactionResultLink.vue +++ b/frontend/src/components/GddSend/TransactionResultLink.vue @@ -5,7 +5,7 @@
{{ $t('gdd_per_link.created') }}
- +

{{ $t('form.close') }} @@ -24,7 +24,7 @@ export default { ClipboardCopy, }, props: { - code: { + link: { type: String, required: true, }, diff --git a/frontend/src/components/TransactionLinks/TransactionLink.vue b/frontend/src/components/TransactionLinks/TransactionLink.vue index 9cbfdfb93..1c5ad690f 100644 --- a/frontend/src/components/TransactionLinks/TransactionLink.vue +++ b/frontend/src/components/TransactionLinks/TransactionLink.vue @@ -55,6 +55,7 @@ export default { props: { amount: { type: String, required: true }, code: { type: String, required: true }, + link: { type: String, required: true }, holdAvailableAmount: { type: String, required: true }, id: { type: Number, required: true }, memo: { type: String, required: true }, @@ -62,7 +63,7 @@ export default { }, methods: { copy() { - const link = `${window.location.origin}/redeem/${this.code}` + const link = `${this.link}` navigator.clipboard .writeText(link) .then(() => { diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 3dbd8888e..754d8930a 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -76,6 +76,7 @@ export const createTransactionLink = gql` mutation($amount: Decimal!, $memo: String!) { createTransactionLink(amount: $amount, memo: $memo) { code + link } } ` diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index b8622ef2d..3452694d4 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -155,6 +155,7 @@ export const listTransactionLinks = gql` holdAvailableAmount memo code + link createdAt validUntil redeemedAt diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index 613342dba..533678a6e 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -41,7 +41,7 @@ >


@@ -88,6 +88,7 @@ export default { currentTransactionStep: TRANSACTION_STEPS.transactionForm, loading: false, code: null, + link: null, } }, props: { @@ -145,6 +146,7 @@ export default { .then((result) => { this.$emit('set-tunneled-email', null) this.code = result.data.createTransactionLink.code + this.link = result.data.createTransactionLink.link this.transactionData = { ...EMPTY_TRANSACTION_DATA } this.currentTransactionStep = TRANSACTION_STEPS.transactionResultLink this.updateTransactions({})