require online location for online only events

This commit is contained in:
lesion
2023-04-09 23:40:16 +02:00
parent 8025ba0f82
commit 071563e34f
2 changed files with 2 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ v-row.mb-4
:prepend-icon='mdiLink' :prepend-icon='mdiLink'
:hint="$t('event.online_locations_help')" :hint="$t('event.online_locations_help')"
:label="$t('event.online_locations')" :label="$t('event.online_locations')"
:rules="[$validators.required('event.online_locations')]"
clearable chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint clearable chips small-chips multiple deletable-chips hide-no-data hide-selected persistent-hint
:delimiters="[',', ';', '; ']" :delimiters="[',', ';', '; ']"
:items="onlineLocations" :items="onlineLocations"

View File

@@ -4,7 +4,7 @@ export default ({ app }, inject) => {
const $t = app.i18n.t.bind(app.i18n) const $t = app.i18n.t.bind(app.i18n)
const validators = { const validators = {
required (fieldName) { required (fieldName) {
return value => !!value || $t('validators.required', { fieldName: $t(fieldName) }) return v => !(v===undefined || v===null || v.length <= 0) || $t('validators.required', { fieldName: $t(fieldName) })
}, },
email: [ email: [
v => !!v || $t('validators.required', { fieldName: $t('common.email') }), v => !!v || $t('validators.required', { fieldName: $t('common.email') }),