Query optimization!

This commit is contained in:
Atridad Lahiji 2023-08-20 22:41:50 -06:00
parent 2228ace13f
commit 3de7d4c0cb
No known key found for this signature in database

View file

@ -56,16 +56,7 @@ export const roomRouter = createTRPCRouter({
const roomFromDb = await ctx.db.query.rooms.findFirst({ const roomFromDb = await ctx.db.query.rooms.findFirst({
where: eq(rooms.id, input.id), where: eq(rooms.id, input.id),
with: { with: {
logs: { logs: true,
with: {
room: true,
},
},
votes: {
with: {
room: true,
},
},
}, },
}); });
return roomFromDb || null; return roomFromDb || null;