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