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 })),
|
||||
};
|
||||
await Api.createEstimate(data);
|
||||
notificationStore.addNotification("Estimate created successfully", "success");
|
||||
notificationStore.addSuccess("Estimate created successfully", "success");
|
||||
router.push(`/estimate?address=${encodeURIComponent(formData.address)}`);
|
||||
// Reset form
|
||||
formData.address = "";
|
||||
@ -326,7 +326,7 @@ const confirmSubmit = async () => {
|
||||
selectedItems.value = [];
|
||||
} catch (error) {
|
||||
console.error("Error creating estimate:", error);
|
||||
notificationStore.addNotification("Failed to create estimate", "error");
|
||||
notificationStore.addError("Failed to create estimate", "error");
|
||||
} finally {
|
||||
isSubmitting.value = false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user