Skip to content

Commit 1258479

Browse files
committed
Sort history rows by descending date
1 parent df0c410 commit 1258479

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/collaboration/src/routes/collaborationRoutes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ router.get("/sessions", async (req: Request, res: Response) => {
7676
router.post("/sessions/:id", async (req: Request, res: Response) => {
7777
try {
7878
const { id } = req.params;
79-
const sessions: TSession[] = await Session.find({ users: id }).exec();
79+
const sessions: TSession[] = await Session.find({ users: id }).sort({ createdAt: -1 }).exec();
8080

8181
return res.status(200).json(sessions);
8282
} catch (error) {

0 commit comments

Comments
 (0)