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