Files
lcbp3/frontend/lib/services/notification.service.ts
T
admin 11984bfa29
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s
260322:1648 Correct Coresspondence / Doing RFA / Correct CI
2026-03-22 16:48:12 +07:00

22 lines
725 B
TypeScript

import apiClient from '@/lib/api/client';
import { NotificationResponse } from '@/types/notification';
export const notificationService = {
getUnread: async (): Promise<NotificationResponse> => {
const response = await apiClient.get('/notifications/unread');
// Backend should return { items: [], unreadCount: number }
// Or just items and we count on frontend, but typically backend gives count.
return response.data;
},
markAsRead: async (uuid: string) => {
const response = await apiClient.put(`/notifications/${uuid}/read`);
return response.data;
},
markAllAsRead: async () => {
const response = await apiClient.patch(`/notifications/read-all`);
return response.data;
},
};