Skip to content

feat: enable mark all inbox notifications as read #17023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions site/src/modules/dashboard/Navbar/NavbarView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Loading