Skip to content

Commit 0cd254f

Browse files
feat: enable mark all inbox notifications as read (#17023)
Bind the "Mark all notifications as read" action to the correct API request in the UI.
1 parent 8d5e6f3 commit 0cd254f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

site/src/api/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,6 +2452,10 @@ class ApiMethods {
24522452
);
24532453
return res.data;
24542454
};
2455+
2456+
markAllInboxNotificationsAsRead = async () => {
2457+
await this.axios.put<void>("/api/v2/notifications/inbox/mark-all-as-read");
2458+
};
24552459
}
24562460

24572461
// This is a hard coded CSRF token/cookie pair for local development. In prod,

site/src/modules/dashboard/Navbar/NavbarView.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
6969

7070
<NotificationsInbox
7171
fetchNotifications={API.getInboxNotifications}
72-
markAllAsRead={() => {
73-
throw new Error("Function not implemented.");
74-
}}
72+
markAllAsRead={API.markAllInboxNotificationsAsRead}
7573
markNotificationAsRead={(notificationId) =>
7674
API.updateInboxNotificationReadStatus(notificationId, {
7775
is_read: true,
@@ -92,9 +90,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
9290
<div className="ml-auto flex items-center gap-3 md:hidden">
9391
<NotificationsInbox
9492
fetchNotifications={API.getInboxNotifications}
95-
markAllAsRead={() => {
96-
throw new Error("Function not implemented.");
97-
}}
93+
markAllAsRead={API.markAllInboxNotificationsAsRead}
9894
markNotificationAsRead={(notificationId) =>
9995
API.updateInboxNotificationReadStatus(notificationId, {
10096
is_read: true,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy