mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Validate different email address
This commit is contained in:
parent
69542617ac
commit
9808e1c4f8
@ -159,6 +159,9 @@
|
||||
"success": "Deine Daten wurden erfolgreich aktualisiert!"
|
||||
},
|
||||
"email": {
|
||||
"validation": {
|
||||
"same-email": "Muss sich unterscheiden von der jetzigen E-Mail Addresse"
|
||||
},
|
||||
"name": "Deine E-Mail",
|
||||
"labelEmail": "E-Mail Adresse ändern",
|
||||
"labelNewEmail": "Neue E-Mail Adresse",
|
||||
|
||||
@ -160,6 +160,9 @@
|
||||
"success": "Your data was successfully updated!"
|
||||
},
|
||||
"email": {
|
||||
"validation": {
|
||||
"same-email": "Must be different from your current E-Mail address"
|
||||
},
|
||||
"name": "Your E-Mail",
|
||||
"labelEmail": "Change your E-Mail address",
|
||||
"labelNewEmail": "New E-Mail Address",
|
||||
|
||||
@ -32,9 +32,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
success: false,
|
||||
formSchema: {
|
||||
email: { type: 'email', required: true },
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -54,6 +51,24 @@ export default {
|
||||
this.formData = formData
|
||||
},
|
||||
},
|
||||
formSchema() {
|
||||
const { email } = this.currentUser
|
||||
const sameEmailValidationError = this.$t('settings.email.validation.same-email')
|
||||
return {
|
||||
email: [
|
||||
{ type: 'email', required: true },
|
||||
{
|
||||
validator(rule, value, callback, source, options) {
|
||||
const errors = []
|
||||
if (email === value) {
|
||||
errors.push(sameEmailValidationError)
|
||||
}
|
||||
return errors
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async submit() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user