Change the Send page so we send another mutation when the user sends a link than send gdds.

This commit is contained in:
elweyn 2022-03-09 17:38:00 +01:00
parent c7bda9b15e
commit 665c30aa60

View File

@ -77,21 +77,36 @@ export default {
this.currentTransactionStep = 1
},
async sendTransaction() {
console.log('TESTETESTESTES')
this.loading = true
this.error = false
this.$apollo
.mutate({
mutation: sendCoins,
variables: this.transactionData,
})
.then(() => {
this.error = false
this.$emit('update-balance', this.transactionData.amount)
})
.catch((err) => {
this.errorResult = err.message
this.error = true
})
if (this.transactionData.selected === 'send') {
this.$apollo
.mutate({
mutation: sendCoins,
variables: this.transactionData,
})
.then(() => {
this.error = false
this.$emit('update-balance', this.transactionData.amount)
})
.catch((err) => {
this.errorResult = err.message
this.error = true
})
} else if (this.transactionData.selected === 'link') {
this.$apollo
.mutate({
mutation: createTransactionLink,
variables: { amount: this.transactionData.amount, memo: this.transactionData.memo },
})
.then((result) => {
console.log(result)
})
.catch((error) => {
this.toastError(error)
})
}
this.currentTransactionStep = 2
this.loading = false
},