Skip to content

Commit

Permalink
✨ Order trains by departure date #1
Browse files Browse the repository at this point in the history
  • Loading branch information
leonekmi committed Feb 24, 2023
1 parent 39531b0 commit 888bfc4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/api/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export const getAlertsOfUser = (id: number, index?: number) =>
export const getAlert = (id: number) =>
prisma.alert.findUnique({
where: { id },
include: { trains: true },
include: {
trains: {
orderBy: { departure: "asc" },
},
},
});

export const dropAlert = (id: number) =>
Expand Down

0 comments on commit 888bfc4

Please sign in to comment.