Fix: convert select values to number or null before submit

This commit is contained in:
csr4422
2025-09-29 17:18:36 +05:30
parent 98f16854c8
commit ec63604163

View File

@@ -57,9 +57,8 @@
<Input type="number" placeholder="0" v-bind="componentField" />
</FormControl>
<FormDescription>
Maximum number of conversations that can be auto-assigned to an agent,
conversations in "Resolved" or "Closed" states do not count toward this limit. Set to 0
for unlimited.
Maximum number of conversations that can be auto-assigned to an agent, conversations in
"Resolved" or "Closed" states do not count toward this limit. Set to 0 for unlimited.
</FormDescription>
<FormMessage />
</FormItem>
@@ -97,6 +96,7 @@
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem :value=0>None</SelectItem>
<SelectItem v-for="bh in businessHours" :key="bh.id" :value="bh.id">
{{ bh.name }}
</SelectItem>
@@ -121,6 +121,7 @@
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem :value=0>None</SelectItem>
<SelectItem
v-for="sla in slaStore.options"
:key="sla.value"
@@ -226,7 +227,11 @@ const fetchBusinessHours = async () => {
}
const onSubmit = form.handleSubmit((values) => {
props.submitForm(values)
props.submitForm({
...values,
business_hours_id: values.business_hours_id ? Number(values.business_hours_id) : null,
sla_policy_id: values.sla_policy_id ? Number(values.sla_policy_id) : null
})
})
watch(