mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 04:33:11 +00:00
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:
parent
0ccf8bdbbc
commit
a7391cb02b
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue