@@ -131,7 +131,7 @@ export function RhfVehicleSelectField<
|
||||
|
||||
const combobox = (
|
||||
<div ref={anchorRef}>
|
||||
<Combobox
|
||||
<Combobox
|
||||
value={field.value}
|
||||
onValueChange={(val: VehicleOption | VehicleOption[] | null) => {
|
||||
const single = Array.isArray(val) ? val[0] ?? null : val
|
||||
@@ -246,7 +246,7 @@ export function RhfVehicleSelectField<
|
||||
<DialogTitle className="text-2xl font-bold">
|
||||
Add {label}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
</DialogHeader>
|
||||
<ScrollArea className="max-h-[80vh] px-4">
|
||||
<VehicleForm onSuccess={handleCreateSuccess} />
|
||||
</ScrollArea>
|
||||
|
||||
@@ -23,6 +23,7 @@ import { useAuthApi } from "@/shared/useApi"
|
||||
import { useResourceForm } from "@/shared/hooks/use-resource-form"
|
||||
import { useFormMutation } from "@/shared/hooks/use-form-mutation"
|
||||
import { toRelation, toId } from "@/shared/lib/utils"
|
||||
import { formatUppercase } from "@/shared/utils/formatters"
|
||||
|
||||
import { vehicleFormSchema, type VehicleFormValues } from "./vehicle.schema"
|
||||
import { VEHICLE_ROUTES } from "@garage/api"
|
||||
@@ -225,7 +226,12 @@ export function VehicleForm({ resourceId, initialData, onSuccess }: VehicleFormP
|
||||
|
||||
{/* License & identifiers */}
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<RhfTextField name="license_plate" label="License Plate" placeholder="e.g. ABC-123" />
|
||||
<RhfTextField
|
||||
name="license_plate"
|
||||
label="License Plate"
|
||||
placeholder="e.g. ABC-123"
|
||||
formatter={formatUppercase}
|
||||
/>
|
||||
<RhfTextField name="mileage" label="Mileage" placeholder="e.g. 10000" />
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user