Skip to content

Commit

Permalink
fix: order messages by start date (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime authored Jul 30, 2024
1 parent fd92242 commit e1de169
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ async function getHandler(
where: {
appId: Number(req.query.appId),
},
orderBy: {
startDate: "asc",
endDate: "asc",
},
});

return res.status(StatusCodes.OK).json(allMessages);
Expand Down
3 changes: 3 additions & 0 deletions pages/api/v0.1/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
},
],
},
orderBy: {
startDate: "asc",
},
});

const ip = requestIp.getClientIp(req);
Expand Down
3 changes: 3 additions & 0 deletions pages/api/v0.2/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
},
],
},
orderBy: {
startDate: "asc",
},
});

const ip = requestIp.getClientIp(req);
Expand Down

0 comments on commit e1de169

Please sign in to comment.