diff --git a/apps/dashboard/modules/job-cards/job-card-check-in-dialog.tsx b/apps/dashboard/modules/job-cards/job-card-check-in-dialog.tsx index 67b5b44..d951b22 100644 --- a/apps/dashboard/modules/job-cards/job-card-check-in-dialog.tsx +++ b/apps/dashboard/modules/job-cards/job-card-check-in-dialog.tsx @@ -24,6 +24,7 @@ import { import { DEPARTMENT_ROUTES } from "@garage/api" import { FUEL_LEVEL_OPTIONS } from "./job-card.schema" import { toId } from "@/shared/lib/utils" +import { DepartmentInlineForm } from "@/modules/services/inline-forms/department-inline-form" // ── Schema ── @@ -46,7 +47,7 @@ const mapLookupOption = (item: any) => ({ label: item.name, }) -const STORE_OBJECT = { storeObject: true } as const +const STORE_OBJECT = { getOptionValue: (o: any) => o, getOptionLabel: (o: any) => o.label } as const // ── Props ── @@ -138,11 +139,10 @@ export function JobCardCheckInDialog({ required queryKey={[DEPARTMENT_ROUTES.INDEX]} listFn={() => api.departments.list()} - mapOption={(op:any)=> ({value: op.id, label: op.name})} + mapOption={(item: any) => ({ value: String(item.id), label: item.name ?? String(item.id) })} + createForm={(props) => } + createLabel="Department" {...STORE_OBJECT} - getOptionLabel={op=>op.label} - getOptionValue={op=>op} - />