Updated estimate creation notifications to use the error and success notifications correctly.
This commit is contained in:
parent
2ac06d8532
commit
cd89156ca0
@ -315,7 +315,7 @@ const confirmSubmit = async () => {
|
|||||||
items: selectedItems.value.map((i) => ({ itemCode: i.itemCode, qty: i.qty })),
|
items: selectedItems.value.map((i) => ({ itemCode: i.itemCode, qty: i.qty })),
|
||||||
};
|
};
|
||||||
await Api.createEstimate(data);
|
await Api.createEstimate(data);
|
||||||
notificationStore.addNotification("Estimate created successfully", "success");
|
notificationStore.addSuccess("Estimate created successfully", "success");
|
||||||
router.push(`/estimate?address=${encodeURIComponent(formData.address)}`);
|
router.push(`/estimate?address=${encodeURIComponent(formData.address)}`);
|
||||||
// Reset form
|
// Reset form
|
||||||
formData.address = "";
|
formData.address = "";
|
||||||
@ -326,7 +326,7 @@ const confirmSubmit = async () => {
|
|||||||
selectedItems.value = [];
|
selectedItems.value = [];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error creating estimate:", error);
|
console.error("Error creating estimate:", error);
|
||||||
notificationStore.addNotification("Failed to create estimate", "error");
|
notificationStore.addError("Failed to create estimate", "error");
|
||||||
} finally {
|
} finally {
|
||||||
isSubmitting.value = false;
|
isSubmitting.value = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user