mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Add link to the TransactionLink and change code by link in frontend.
This commit is contained in:
parent
d984ff2582
commit
41b35f2c5e
@ -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()
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<b-card class="p-0 gradido-custom-background">
|
||||
<div class="p-4">
|
||||
<div class="h3 mb-5">{{ $t('gdd_per_link.created') }}</div>
|
||||
<clipboard-copy :code="code" />
|
||||
<clipboard-copy :link="link" />
|
||||
</div>
|
||||
<p class="text-center mt-3">
|
||||
<b-button variant="success" @click="$emit('on-reset')">{{ $t('form.close') }}</b-button>
|
||||
@ -24,7 +24,7 @@ export default {
|
||||
ClipboardCopy,
|
||||
},
|
||||
props: {
|
||||
code: {
|
||||
link: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
|
||||
@ -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(() => {
|
||||
|
||||
@ -76,6 +76,7 @@ export const createTransactionLink = gql`
|
||||
mutation($amount: Decimal!, $memo: String!) {
|
||||
createTransactionLink(amount: $amount, memo: $memo) {
|
||||
code
|
||||
link
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
@ -155,6 +155,7 @@ export const listTransactionLinks = gql`
|
||||
holdAvailableAmount
|
||||
memo
|
||||
code
|
||||
link
|
||||
createdAt
|
||||
validUntil
|
||||
redeemedAt
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
></transaction-result-send-error>
|
||||
</template>
|
||||
<template #transactionResultLink>
|
||||
<transaction-result-link :code="code" @on-reset="onReset"></transaction-result-link>
|
||||
<transaction-result-link :link="link" @on-reset="onReset"></transaction-result-link>
|
||||
</template>
|
||||
</gdd-send>
|
||||
<hr />
|
||||
@ -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({})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user