feat : modification des notifications + correction de bug

This commit is contained in:
2026-03-10 10:01:36 +01:00
parent 701dd9faf3
commit 53255dba43
25 changed files with 932 additions and 519 deletions

View File

@@ -1,7 +1,9 @@
export type NotificationItem = {
id: number
title: string
actorName: string
message: string
category: string
target: string
isRead: boolean
createdAt: string
}

View File

@@ -12,6 +12,28 @@ export const listUnreadNotifications = async () => {
return extractItems<NotificationItem>(data)
}
export const listTodayNotifications = async () => {
const api = useApi()
const data = await api.get<NotificationItem[] | { 'hydra:member'?: NotificationItem[] }>(
'/notifications/today',
{},
{ toast: false }
)
return extractItems<NotificationItem>(data)
}
export const listHistoryNotifications = async () => {
const api = useApi()
const data = await api.get<NotificationItem[] | { 'hydra:member'?: NotificationItem[] }>(
'/notifications/history',
{},
{ toast: false }
)
return extractItems<NotificationItem>(data)
}
export const markAllNotificationsRead = async () => {
const api = useApi()
return api.post('/notifications/mark-all-read', {}, { toast: false })