feat : ajout des notifications

This commit is contained in:
2026-03-02 16:17:08 +01:00
parent e0f2a84f2c
commit 7a3d01d77f
14 changed files with 512 additions and 3 deletions

View File

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

View File

@@ -0,0 +1,18 @@
import type { NotificationItem } from './dto/notification'
import { extractItems } from '~/utils/api'
export const listUnreadNotifications = async () => {
const api = useApi()
const data = await api.get<NotificationItem[] | { 'hydra:member'?: NotificationItem[] }>(
'/notifications/unread',
{},
{ toast: false }
)
return extractItems<NotificationItem>(data)
}
export const markAllNotificationsRead = async () => {
const api = useApi()
return api.post('/notifications/mark-all-read', {}, { toast: false })
}