diff --git a/src/services/notificationService.ts b/src/services/notificationService.ts index af462a9..d4cf687 100644 --- a/src/services/notificationService.ts +++ b/src/services/notificationService.ts @@ -31,7 +31,8 @@ export interface UnreadCountResponse { export const notificationService = { getNotifications: (page: number = 1, limit: number = 10, isRead?: boolean) => { - const params: Record = { page, limit }; + const offset = (page - 1) * limit; + const params: Record = { offset, limit }; if (isRead !== undefined) { params.is_read = isRead; } @@ -47,6 +48,6 @@ export const notificationService = { }, markAllAsRead: () => { - return api.put<{ success: boolean }>('/notifications/read-all'); + return api.post<{ success: boolean }>('/notifications/read-all'); } };