diff --git a/client/src/Pages/Notifications/create/index.jsx b/client/src/Pages/Notifications/create/index.jsx index 71d7dc4af..737d231e0 100644 --- a/client/src/Pages/Notifications/create/index.jsx +++ b/client/src/Pages/Notifications/create/index.jsx @@ -44,7 +44,10 @@ const CreateNotifications = () => { const BREADCRUMBS = [ { name: "notifications", path: "/notifications" }, - { name: notificationId ? "edit" : "create", path: notificationId ? `/notifications/${notificationId}` : "/notifications/create" }, + { + name: notificationId ? "edit" : "create", + path: notificationId ? `/notifications/${notificationId}` : "/notifications/create", + }, ]; // Redux state @@ -133,9 +136,17 @@ const CreateNotifications = () => { const onDelete = () => { if (notificationId) { - deleteNotification(notificationId, () => { - navigate("/notifications"); - }); + deleteNotification( + notificationId, + () => navigate("/notifications"), // Success callback + (error) => { + // Error handling + createToast({ + body: `Delete failed: ${error.message}`, + type: "error", + }); + } + ); } };