From 0d2390c1348276339d1406e0e3e58f9250c15412 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Sun, 20 Aug 2023 22:41:50 -0600 Subject: [PATCH] Query optimization! --- src/server/api/routers/room.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/server/api/routers/room.ts b/src/server/api/routers/room.ts index 3868b2a..f433a3a 100644 --- a/src/server/api/routers/room.ts +++ b/src/server/api/routers/room.ts @@ -56,16 +56,7 @@ export const roomRouter = createTRPCRouter({ const roomFromDb = await ctx.db.query.rooms.findFirst({ where: eq(rooms.id, input.id), with: { - logs: { - with: { - room: true, - }, - }, - votes: { - with: { - room: true, - }, - }, + logs: true, }, }); return roomFromDb || null;