Updated estimate creation notifications to use the error and success notifications correctly.

This commit is contained in:
rocketdebris 2025-12-01 14:30:47 -05:00
parent 2ac06d8532
commit cd89156ca0

View File

@ -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;
} }