diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 8616430..5faeb33 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -40,7 +40,7 @@ function Header() { const data: Notification[] = notifData || []; setNotifications(data); - const hasUnread = data.some(n => n.pivot && n.pivot.unread === 1); + const hasUnread = data.some(n => n.read_at === null); setunreadNotification(hasUnread); } catch (err) { console.error("Erreur initialisation Header:", err); diff --git a/src/components/NotificationCard/NotificationCard.tsx b/src/components/NotificationCard/NotificationCard.tsx index e2086aa..f411215 100644 --- a/src/components/NotificationCard/NotificationCard.tsx +++ b/src/components/NotificationCard/NotificationCard.tsx @@ -5,7 +5,7 @@ import Notification from "../../interfaces/notification.interface"; interface NotificationCardProps { notifications: Notification[]; - deleteNotification: (id: number) => void; + deleteNotification: (id: string) => void; } function NotificationCard({ notifications, deleteNotification }: NotificationCardProps) { @@ -25,9 +25,9 @@ function NotificationCard({ notifications, deleteNotification }: NotificationCar -
- {notification.content} + {notification.data.message}