correct created_at attribute of notifications
This commit is contained in:
@@ -6,6 +6,7 @@ export const userCreatedListener = (echo, userData, setNotifications, setunreadN
|
||||
const newNotification = {
|
||||
id: Date.now(),
|
||||
content: `Nouvelle demande d'inscription : ${event.user.name} ${event.user.lastname}`,
|
||||
created_at: Date.now(),
|
||||
pivot: { unread: 1 }
|
||||
};
|
||||
setNotifications(prev => [newNotification, ...prev]);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import formatDateTime from '../../date/formatTime.js';
|
||||
|
||||
export const userNotificationsListener = (echo, userData, setNotifications, setunreadNotification) => {
|
||||
if (!userData?.id) return null;
|
||||
|
||||
@@ -10,7 +8,7 @@ export const userNotificationsListener = (echo, userData, setNotifications, setu
|
||||
const newNotification = {
|
||||
id: Date.now(),
|
||||
content: `L'événement ${event.event.name} a été supprimé ! Vous n'y participez donc plus.`,
|
||||
created_at: formatDateTime(Date.now()),
|
||||
created_at: Date.now(),
|
||||
pivot: { unread: 1 }
|
||||
};
|
||||
setNotifications(prev => [newNotification, ...prev]);
|
||||
@@ -20,7 +18,7 @@ export const userNotificationsListener = (echo, userData, setNotifications, setu
|
||||
const newNotification = {
|
||||
id: Date.now(),
|
||||
content: `La tâche ${event.task.name} de l'événement ${event.event.name} a été supprimé ! Vous n'y participez donc plus.`,
|
||||
created_at: formatDateTime(Date.now()),
|
||||
created_at: Date.now(),
|
||||
pivot: { unread: 1 }
|
||||
};
|
||||
setNotifications(prev => [newNotification, ...prev]);
|
||||
@@ -30,7 +28,7 @@ export const userNotificationsListener = (echo, userData, setNotifications, setu
|
||||
const newNotification = {
|
||||
id: Date.now(),
|
||||
content: `Vous avez été assigné à la tâche ${event.task.name} de l'événement ${event.event.name}`,
|
||||
created_at: formatDateTime(Date.now()),
|
||||
created_at: Date.now(),
|
||||
pivot: { unread: 1 }
|
||||
};
|
||||
setNotifications(prev => [newNotification, ...prev]);
|
||||
@@ -40,7 +38,7 @@ export const userNotificationsListener = (echo, userData, setNotifications, setu
|
||||
const newNotification = {
|
||||
id: Date.now(),
|
||||
content: `Vous avez été désassigné de la tâche ${event.task.name} de l'événement ${event.event.name}`,
|
||||
created_at: formatDateTime(Date.now()),
|
||||
created_at: Date.now(),
|
||||
pivot: { unread: 1 }
|
||||
};
|
||||
setNotifications(prev => [newNotification, ...prev]);
|
||||
|
||||
Reference in New Issue
Block a user