mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Add custom error messages for events.
Co-authored-by: maeckes <markus@infinity.labs.ooo>
This commit is contained in:
parent
3dadfd4329
commit
4e43b77da2
@ -286,11 +286,32 @@ export default {
|
||||
},
|
||||
},
|
||||
eventStart: { required: !!this.createEvent },
|
||||
eventVenue: { required: !!this.createEvent, min: 3, max: 100 },
|
||||
eventVenue: {
|
||||
required: !!this.createEvent,
|
||||
min: 3,
|
||||
max: 100,
|
||||
validator: (_, value = '') => {
|
||||
if (!value.trim()) {
|
||||
return [new Error(this.$t('common.validations.eventVenueNotEmpty'))]
|
||||
}
|
||||
if (value.length < 3 || value.length > 100) {
|
||||
return [new Error(this.$t('common.validations.eventVenueLength', { min: 3, max: 100 }))]
|
||||
}
|
||||
return []
|
||||
}, },
|
||||
eventLocationName: {
|
||||
required: !!this.createEvent && !this.formData.eventIsOnline,
|
||||
min: 3,
|
||||
max: 100,
|
||||
validator: (_, value = '') => {
|
||||
if (!value.trim()) {
|
||||
return [new Error(this.$t('common.validations.eventLocationNameNotEmpty'))]
|
||||
}
|
||||
if (value.length < 3 || value.length > 100) {
|
||||
return [new Error(this.$t('common.validations.eventLocationNameLength', { min: 3, max: 100 }))]
|
||||
}
|
||||
return []
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@ -115,6 +115,10 @@
|
||||
"validations": {
|
||||
"categories": "es müssen eine bis drei Themen ausgewählt werden",
|
||||
"email": "muss eine gültige E-Mail-Adresse sein",
|
||||
"eventLocationNameLength": "Mindestens {min} Maximal {max}",
|
||||
"eventLocationNameNotEmpty": "es dürfen nicht nur Freizeichen eingetragen werden",
|
||||
"eventVenueLength": "Mindestens {min} Maximal {max}",
|
||||
"eventVenueNotEmpty": "es dürfen nicht nur Freizeichen eingetragen werden",
|
||||
"url": "muss eine gültige URL sein"
|
||||
},
|
||||
"versus": "Versus"
|
||||
|
||||
@ -115,6 +115,10 @@
|
||||
"validations": {
|
||||
"categories": "at least one and at most three topics must be selected",
|
||||
"email": "must be a valid e-mail address",
|
||||
"eventLocationNameLength": "minimal {min} maximal {max}",
|
||||
"eventLocationNameNotEmpty": "only empty characters are not allowed",
|
||||
"eventVenueLength": "minimal {min} maximal {max}",
|
||||
"eventVenueNotEmpty": "only empty characters are not allowed",
|
||||
"url": "must be a valid URL"
|
||||
},
|
||||
"versus": "Versus"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user