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.
This commit is contained in:
Bruno Quaresma
2025-03-20 10:30:05 -03:00
committed by GitHub
parent 8d5e6f3cc0
commit 0cd254f219
2 changed files with 6 additions and 6 deletions
+4
View File
@@ -2452,6 +2452,10 @@ class ApiMethods {
);
return res.data;
};
markAllInboxNotificationsAsRead = async () => {
await this.axios.put<void>("/api/v2/notifications/inbox/mark-all-as-read");
};
}
// This is a hard coded CSRF token/cookie pair for local development. In prod,
@@ -69,9 +69,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
<NotificationsInbox
fetchNotifications={API.getInboxNotifications}
markAllAsRead={() => {
throw new Error("Function not implemented.");
}}
markAllAsRead={API.markAllInboxNotificationsAsRead}
markNotificationAsRead={(notificationId) =>
API.updateInboxNotificationReadStatus(notificationId, {
is_read: true,
@@ -92,9 +90,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
<div className="ml-auto flex items-center gap-3 md:hidden">
<NotificationsInbox
fetchNotifications={API.getInboxNotifications}
markAllAsRead={() => {
throw new Error("Function not implemented.");
}}
markAllAsRead={API.markAllInboxNotificationsAsRead}
markNotificationAsRead={(notificationId) =>
API.updateInboxNotificationReadStatus(notificationId, {
is_read: true,