feat: enhance notifications system by introducing category-based filtering for comments and status, improving user experience in the inbox and API interactions

This commit is contained in:
Anish Sarkar 2026-03-06 19:35:35 +05:30
parent eb775fea11
commit 1a688c7161
8 changed files with 180 additions and 165 deletions

View file

@ -3,6 +3,7 @@ import {
type GetNotificationsResponse,
type GetSourceTypesResponse,
type GetUnreadCountResponse,
type NotificationCategory,
getNotificationsRequest,
getNotificationsResponse,
getSourceTypesResponse,
@ -44,6 +45,9 @@ class NotificationsApiService {
if (queryParams.type) {
params.append("type", queryParams.type);
}
if (queryParams.category) {
params.append("category", queryParams.category);
}
if (queryParams.source_type) {
params.append("source_type", queryParams.source_type);
}
@ -119,14 +123,14 @@ class NotificationsApiService {
/**
* Get unread notification count with split between total and recent
* - total_unread: All unread notifications
* - recent_unread: Unread within sync window (last 14 days)
* @param searchSpaceId - Optional search space ID to filter by
* @param type - Optional notification type to filter by (type-safe enum)
* @param category - Optional category filter ('comments' or 'status')
*/
getUnreadCount = async (
searchSpaceId?: number,
type?: InboxItemTypeEnum
type?: InboxItemTypeEnum,
category?: NotificationCategory
): Promise<GetUnreadCountResponse> => {
const params = new URLSearchParams();
if (searchSpaceId !== undefined) {
@ -135,6 +139,9 @@ class NotificationsApiService {
if (type) {
params.append("type", type);
}
if (category) {
params.append("category", category);
}
const queryString = params.toString();
return baseApiService.get(