Files
lcbp3/frontend/lib/services/notification.service.ts
T
admin c5c3ed9016
Build and Deploy / deploy (push) Successful in 9m24s
260316:1117 20260316:1100 Refactor UUID
2026-03-16 11:17:15 +07:00

22 lines
724 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;
}
};