From e1f67df7944d4f7959c782bf87b276e6bd937eac Mon Sep 17 00:00:00 2001 From: ogerly Date: Fri, 18 Mar 2022 09:34:11 +0100 Subject: [PATCH] add redeem modal and start function redeemLink() --- frontend/src/graphql/mutations.js | 6 +++++ frontend/src/locales/de.json | 1 + frontend/src/locales/en.json | 1 + .../pages/ShowTransactionLinkInformations.vue | 24 +++++++++---------- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 89721f02b..8db6dc079 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -75,3 +75,9 @@ export const deleteTransactionLink = gql` deleteTransactionLink(id: $id) } ` + +export const redeemTransactionLink = gql` + mutation($id: Float!) { + redeemTransactionLink(id: $id) + } +` diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index d3bf16157..13df1c3da 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -104,6 +104,7 @@ "link-copied": "Link wurde in die Zwischenablage kopiert", "links_count": "Aktive Links", "links_sum": "Summe deiner versendeten Gradidos", + "link-overview":"Linkübersicht", "not-copied": "Konnte den Link nicht kopieren: {err}", "sentence_1": "Wähle einen Betrag aus, welchen du per Link versenden möchtest. Du kannst auch noch eine Nachricht eintragen. Beim Klick „jetzt generieren“ wird ein Link erstellt, den du versenden kannst.", "redeem":"Einlösen", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 844d9a5f2..a2315f021 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -104,6 +104,7 @@ "link-copied": "Link copied to clipboard", "links_count": "Active links", "links_sum": "Total of your sent Gradidos", + "link-overview":"Link overview", "not-copied": "Could not copy link: {err}", "sentence_1": "Select an amount that you would like to send via link. You can also enter a message. Click 'Generate now' to create a link that you can share.", "redeem": "Redeem", diff --git a/frontend/src/pages/ShowTransactionLinkInformations.vue b/frontend/src/pages/ShowTransactionLinkInformations.vue index 67db48ab3..e855f2f2c 100644 --- a/frontend/src/pages/ShowTransactionLinkInformations.vue +++ b/frontend/src/pages/ShowTransactionLinkInformations.vue @@ -2,10 +2,6 @@ @@ -90,12 +91,13 @@ export default { .mutate({ mutation: redeemTransactionLink, variables: { - id: this.id, + id: this.displaySetup.id, }, }) - .then(() => { - this.toastSuccess(this.$t('gdd_per_link.deleted')) - this.$emit('reset-transaction-link-list') + .then((result) => { + alert(result.data.redeemTransactionLink) + // this.toastSuccess(this.$t('gdd_per_link.deleted')) + // this.$emit('reset-transaction-link-list') }) .catch((err) => { this.toastError(err.message) @@ -105,13 +107,11 @@ export default { }, computed: { disabled() { - return this.displaySetup.user.email === this.$store.state.email ? true : false - + return this.displaySetup.user.email === this.$store.state.email }, }, created() { this.setTransactionLinkInformation() - console.log(this) }, }