fix build error

This commit is contained in:
Mohammad Khyata 2026-04-08 15:04:01 +03:00
parent bb02b77be2
commit 17d8e1c90d

View File

@ -112,7 +112,7 @@ function mapFormToPayload(values: InspectionFormValues) {
department_id: toId(values.department), department_id: toId(values.department),
inspection_category_id: toId(values.inspection_category), inspection_category_id: toId(values.inspection_category),
employee_id: toId(values.employee), employee_id: toId(values.employee),
job_card_id: toId(values.job_card) ?? null, job_card_id: values.job_card?.value ?? undefined,
labor_rate_id: values.labor_rate ? Number(values.labor_rate.value) : undefined, labor_rate_id: values.labor_rate ? Number(values.labor_rate.value) : undefined,
title: values.title, title: values.title,
order_number: values.order_number || undefined, order_number: values.order_number || undefined,
@ -168,7 +168,7 @@ export function InspectionForm({ resourceId, initialData, onSuccess }: Inspectio
mutationFn: (values: InspectionFormValues) => { mutationFn: (values: InspectionFormValues) => {
const payload = mapFormToPayload(values) const payload = mapFormToPayload(values)
const promise = (isEditing && resourceId const promise = (isEditing && resourceId
? api.inspections.update(resourceId, payload) ? api.inspections.update(resourceId, payload as any)
: api.inspections.create(payload)) as any : api.inspections.create(payload)) as any
toast.promise(promise, { toast.promise(promise, {
loading: isEditing ? "Updating inspection..." : "Creating inspection...", loading: isEditing ? "Updating inspection..." : "Creating inspection...",