From c6a56df94af3936eb27487990da52504732c4913 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 5 Mar 2025 15:25:52 +0700 Subject: [PATCH] fix: notification order --- src/controllers/00-notification-controller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/00-notification-controller.ts b/src/controllers/00-notification-controller.ts index d8285f4..d9b90c0 100644 --- a/src/controllers/00-notification-controller.ts +++ b/src/controllers/00-notification-controller.ts @@ -64,7 +64,11 @@ export class NotificationController extends Controller { }, }; const [result, total] = await prisma.$transaction([ - prisma.notification.findMany({ where, include: { readByUser: true } }), + prisma.notification.findMany({ + where, + include: { readByUser: true }, + orderBy: { createdAt: "desc" }, + }), prisma.notification.count({ where }), ]);