running npm run format
This commit is contained in:
1 file changed
+15
-4
@@ -44,7 +44,10 @@ const CreateNotifications = () => {
|
|||||||
|
|
||||||
const BREADCRUMBS = [
|
const BREADCRUMBS = [
|
||||||
{ name: "notifications", path: "/notifications" },
|
{ 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
|
// Redux state
|
||||||
@@ -133,9 +136,17 @@ const CreateNotifications = () => {
|
|||||||
|
|
||||||
const onDelete = () => {
|
const onDelete = () => {
|
||||||
if (notificationId) {
|
if (notificationId) {
|
||||||
deleteNotification(notificationId, () => {
|
deleteNotification(
|
||||||
navigate("/notifications");
|
notificationId,
|
||||||
});
|
() => navigate("/notifications"), // Success callback
|
||||||
|
(error) => {
|
||||||
|
// Error handling
|
||||||
|
createToast({
|
||||||
|
body: `Delete failed: ${error.message}`,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user