Fix undefined work order ID on edit save

- formData.id was undefined because id isn't in the initial form state
- Pass id from useParams explicitly when calling editWorkOrder
This commit is contained in:
Adam Moussa 2026-04-16 17:47:21 -04:00
parent 0ccf8bdbbc
commit a7391cb02b

View file

@ -70,7 +70,7 @@ export default function WorkOrderFormPage() {
try {
if (isEdit) {
await editWorkOrder(formData);
await editWorkOrder({ ...formData, id });
toast.success("Work Order updated successfully!");
} else {
await addWorkOrder(formData);