You cannot send GDD to yourself

This commit is contained in:
Moriz Wahl 2021-05-10 21:18:46 +02:00
parent 4ee158bf32
commit 3cf42b33ee
4 changed files with 22 additions and 4 deletions

View File

@ -46,7 +46,8 @@
"thx":"Danke,",
"send_success":"deine Transaktion wurde erfolgreich ausgeführt",
"validation": {
"double": "Das Feld {field} muss eine Dezimalzahl mit zwei Nachkommastellen sein"
"double": "Das Feld {field} muss eine Dezimalzahl mit zwei Nachkommastellen sein",
"is-not": "Du kannst Dir selbst keine Gradidos überweisen"
}
},
"error": {

View File

@ -46,7 +46,8 @@
"thx":"Thank you,",
"send_success":"your transaction was successfully completed",
"validation": {
"double": "The {field} field must be a decimal with two digits"
"double": "The {field} field must be a decimal with two digits",
"is-not": "You cannot send Gradidos to yourself"
}
},
"error": {

View File

@ -3,7 +3,8 @@ import DashboardPlugin from './plugins/dashboard-plugin'
import App from './App.vue'
import i18n from './i18n.js'
import { configure, extend } from 'vee-validate'
import { required, email, min, between, double } from 'vee-validate/dist/rules'
// eslint-disable-next-line camelcase
import { required, email, min, between, double, is_not } from 'vee-validate/dist/rules'
// store
import { store } from './store/store'
@ -55,6 +56,13 @@ extend('between', {
message: (_, values) => i18n.t('validations.messages.between', values),
})
// eslint-disable-next-line camelcase
extend('is_not', {
// eslint-disable-next-line camelcase
...is_not,
message: (_, values) => i18n.t('form.validation.is-not', values),
})
/* eslint-disable no-new */
new Vue({
el: '#app',

View File

@ -53,7 +53,15 @@
</div>
<br />
<div>
<validation-provider name="Email" rules="required|email" v-slot="{ errors }">
<validation-provider
name="Email"
:rules="{
required: true,
email: true,
is_not: $store.state.email,
}"
v-slot="{ errors }"
>
<b-row>
<b-col class="text-left p-3 p-sm-1">{{ $t('form.receiver') }}</b-col>
<b-col v-if="errors" class="text-right p-3 p-sm-1">