fix: notification order
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s

This commit is contained in:
Methapon2001 2025-03-05 15:25:52 +07:00
parent 071262a85a
commit c6a56df94a

View file

@ -64,7 +64,11 @@ export class NotificationController extends Controller {
}, },
}; };
const [result, total] = await prisma.$transaction([ 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 }), prisma.notification.count({ where }),
]); ]);