From 0c1fc12ed9b3155bacda54d47bf40ec111d921b7 Mon Sep 17 00:00:00 2001 From: OxSaitama Date: Tue, 24 Oct 2023 21:52:07 +0200 Subject: [PATCH] order notifications by date --- .../Api/LeCoffreApi/Notary/Notifications/Notifications.ts | 1 + .../Components/DesignSystem/Header/Navigation/index.tsx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/front/Api/LeCoffreApi/Notary/Notifications/Notifications.ts b/src/front/Api/LeCoffreApi/Notary/Notifications/Notifications.ts index bdecfcce..79b658f9 100644 --- a/src/front/Api/LeCoffreApi/Notary/Notifications/Notifications.ts +++ b/src/front/Api/LeCoffreApi/Notary/Notifications/Notifications.ts @@ -6,6 +6,7 @@ export interface IGetNotificationsParams { where?: {}; include?: {}; select?: {}; + orderBy?: {}; } export type IPutNotificationsParams = { diff --git a/src/front/Components/DesignSystem/Header/Navigation/index.tsx b/src/front/Components/DesignSystem/Header/Navigation/index.tsx index 6134b4a8..fc98f632 100644 --- a/src/front/Components/DesignSystem/Header/Navigation/index.tsx +++ b/src/front/Components/DesignSystem/Header/Navigation/index.tsx @@ -39,6 +39,12 @@ export default function Navigation() { where: { read: false, }, + include: { + notification: true + }, + orderBy: { + notification: {created_at: "desc"}, + } }); notifications.forEach((notification) => { Toasts.getInstance().open({