feature: version one notification feature implemented.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { apiClient } from '@/lib/api/client';
|
||||
import type { InboxPage, UserNotificationItem } from '@/types/notifications';
|
||||
import type { LabCaseActivityItem } from '@/types/lab-case-activity';
|
||||
import type { LabCaseTabReadTarget, TabBadgeCounts } from '@/lib/tabBadgeUtils';
|
||||
|
||||
@@ -27,4 +28,29 @@ export const notificationsApi = {
|
||||
const response = await apiClient.post('/notifications/mark-case-read', { labCaseId });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
listInbox: async (params?: {
|
||||
limit?: number;
|
||||
cursor?: string;
|
||||
}): Promise<{ success: boolean; data: InboxPage }> => {
|
||||
const response = await apiClient.get('/notifications/inbox', { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
inboxUnreadCount: async (): Promise<{ success: boolean; data: { count: number } }> => {
|
||||
const response = await apiClient.get('/notifications/inbox/unread-count');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
markInboxRead: async (
|
||||
id: string,
|
||||
): Promise<{ success: boolean; data: UserNotificationItem | null }> => {
|
||||
const response = await apiClient.post(`/notifications/inbox/${id}/read`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
markInboxReadAll: async (): Promise<{ success: boolean }> => {
|
||||
const response = await apiClient.post('/notifications/inbox/read-all');
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user