feature/IO-3096-GlobalNotifications - add Dayjs, minor packages on backend
This commit is contained in:
@@ -79,7 +79,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
|
||||
__typename: notif.__typename
|
||||
};
|
||||
})
|
||||
.sort((a, b) => day(b.created_at).diff(day(a.created_at)));
|
||||
.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
|
||||
setNotifications(processedNotifications);
|
||||
setError(null);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
|
||||
const handleMarkAllRead = useCallback(() => {
|
||||
markAllNotificationsRead()
|
||||
.then(() => {
|
||||
const timestamp = day().toISOString();
|
||||
const timestamp = new Date().toISOString();
|
||||
setNotifications((prev) => {
|
||||
const updatedNotifications = prev.map((notif) =>
|
||||
notif.read === null && notif.associationid === userAssociationId
|
||||
@@ -137,7 +137,7 @@ export function NotificationCenterContainer({ visible, onClose, bodyshop }) {
|
||||
variables: { id: notificationId }
|
||||
})
|
||||
.then(() => {
|
||||
const timestamp = day().toISOString();
|
||||
const timestamp = new Date().toISOString();
|
||||
setNotifications((prev) => {
|
||||
return prev.map((notif) =>
|
||||
notif.id === notificationId && !notif.read ? { ...notif, read: timestamp } : notif
|
||||
|
||||
Reference in New Issue
Block a user