From 888bfc424ee9fc824216322f9267502d457a807c Mon Sep 17 00:00:00 2001 From: leonekmi Date: Fri, 24 Feb 2023 21:38:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Order=20trains=20by=20departure=20d?= =?UTF-8?q?ate=20#1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/prisma.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/prisma.ts b/src/api/prisma.ts index 7c30b0b..ca4113f 100644 --- a/src/api/prisma.ts +++ b/src/api/prisma.ts @@ -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) =>