rename content into message for notifications
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user