improvement: notify counter badge added to treatment and tasks tabs for upadted and edited cases.
This commit is contained in:
19
frontend/src/lib/api/notifications.ts
Normal file
19
frontend/src/lib/api/notifications.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { apiClient } from '@/lib/api/client';
|
||||
import type { LabCaseTabReadTarget, TabBadgeCounts } from '@/lib/tabBadgeUtils';
|
||||
|
||||
export const notificationsApi = {
|
||||
tabCounts: async (): Promise<{ success: boolean; data: TabBadgeCounts }> => {
|
||||
const response = await apiClient.get('/notifications/tab-counts');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
markTabRead: async (tab: LabCaseTabReadTarget): Promise<{ success: boolean }> => {
|
||||
const response = await apiClient.post('/notifications/mark-tab-read', { tab });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
markCaseRead: async (labCaseId: string): Promise<{ success: boolean }> => {
|
||||
const response = await apiClient.post('/notifications/mark-case-read', { labCaseId });
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user