Query optimization!
This commit is contained in:
parent
0420a5b232
commit
0d2390c134
1 changed files with 1 additions and 10 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue