From a60f99a5e5024d81eb2947c7028a2731fc3b0456 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Thu, 23 Mar 2023 11:49:12 +0100 Subject: [PATCH] send coins works with gradido ID and email --- .../GddSend/TransactionConfirmationSend.vue | 7 +++---- .../src/components/GddSend/TransactionForm.vue | 14 ++++++++------ frontend/src/pages/Send.vue | 6 ++---- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/GddSend/TransactionConfirmationSend.vue b/frontend/src/components/GddSend/TransactionConfirmationSend.vue index b7c35f089..a9058558c 100644 --- a/frontend/src/components/GddSend/TransactionConfirmationSend.vue +++ b/frontend/src/components/GddSend/TransactionConfirmationSend.vue @@ -5,9 +5,7 @@ -
- {{ email }} -
+
{{ userName ? userName : identifier }}
{{ $t('form.memo') }}
{{ memo }}
@@ -64,9 +62,10 @@ export default { name: 'TransactionConfirmationSend', props: { balance: { type: Number, required: true }, - email: { type: String, required: false, default: '' }, + identifier: { type: String, required: false, default: '' }, amount: { type: Number, required: true }, memo: { type: String, required: true }, + userName: { type: String, default: '' }, }, data() { return { diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 9cc696878..7d2a0aae4 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -55,7 +55,7 @@ :name="$t('form.recipient')" :label="$t('form.recipient')" :placeholder="$t('form.email')" - v-model="form.email" + v-model="form.identifier" :disabled="isBalanceDisabled" @onValidation="onValidation" /> @@ -148,7 +148,7 @@ export default { data() { return { form: { - email: this.identifier, + identifier: this.identifier, amount: this.amount ? String(this.amount) : '', memo: this.memo, }, @@ -161,16 +161,18 @@ export default { this.$refs.formValidator.validate() }, onSubmit() { + if (this.gradidoID) this.form.identifier = this.gradidoID this.$emit('set-transaction', { selected: this.radioSelected, - identifier: this.form.email, + identifier: this.form.identifier, amount: Number(this.form.amount.replace(',', '.')), memo: this.form.memo, + userName: this.userName, }) }, onReset(event) { event.preventDefault() - this.form.email = '' + this.form.identifier = '' this.form.amount = '' this.form.memo = '' this.$refs.formValidator.validate() @@ -200,7 +202,7 @@ export default { computed: { disabled() { if ( - this.form.email.length > 5 && + this.form.identifier.length > 5 && parseInt(this.form.amount) <= parseInt(this.balance) && this.form.memo.length > 5 && this.form.memo.length <= 255 @@ -220,7 +222,7 @@ export default { }, }, mounted() { - if (this.form.email !== '') this.$refs.formValidator.validate() + if (this.form.identifier !== '') this.$refs.formValidator.validate() }, } diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue index f8a09ee29..f64fc9045 100644 --- a/frontend/src/pages/Send.vue +++ b/frontend/src/pages/Send.vue @@ -11,9 +11,7 @@