(fix) #1 in frontend

required services have to be >= 1
This commit is contained in:
Tim Gröger 2023-05-12 23:37:20 +02:00
parent c5012c8431
commit 252072df57
1 changed files with 7 additions and 2 deletions

View File

@ -40,12 +40,12 @@
:rules="[notEmpty]" :rules="[notEmpty]"
/> />
<q-input <q-input
v-model="job.required_services" v-model.number="job.required_services"
filled filled
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Dienstanzahl" label="Dienstanzahl"
type="number" type="number"
:rules="[notEmpty]" :rules="[minOneService, notEmpty]"
/> />
<q-input <q-input
v-model="job.comment" v-model="job.comment"
@ -134,6 +134,10 @@ export default defineComponent({
validate: () => form.value?.validate() || Promise.resolve(true), validate: () => form.value?.validate() || Promise.resolve(true),
}); });
function minOneService(val: number) {
return parseInt(val) > 0 || 'Mindestens ein Dienst nötig';
}
return { return {
form, form,
formatStartEnd, formatStartEnd,
@ -141,6 +145,7 @@ export default defineComponent({
job, job,
jobtypes, jobtypes,
notEmpty, notEmpty,
minOneService,
typeName, typeName,
}; };
}, },