rename content into message for notifications

This commit is contained in:
2026-03-28 17:11:27 +01:00
parent ef30e27ad7
commit d23fd55134
3 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -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);
@@ -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
</button>
</div>
<div className={styles.cardContent}>
<div>
<p className={styles.message}>
{notification.content}
{notification.data.message}
</p>
</div>
</div>
+7 -5
View File
@@ -1,6 +1,8 @@
export default interface Notification {
id: number;
content: string;
created_at: string | number;
pivot: { unread: number };
}
id: string;s
data: {
message: string;
};
read_at: string | null;
created_at: string;
}