Fix duplicated data returned by Prisma query in team availability view (#18416)

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
Cao Hoang
2024-12-30 21:15:27 +00:00
committed by GitHub
co-authored by Udit Takkar
parent 116c765c36
commit d8027fe248
@@ -67,9 +67,7 @@ async function getTeamMembers({
},
cursor: cursor ? { id: cursor } : undefined,
take: limit + 1, // We take +1 as itll be used for the next cursor
orderBy: {
id: "asc",
},
orderBy: [{ userId: "asc" }, { id: "asc" }], // Prisma require a unique field for tie breaking duplicate value for pagination
distinct: ["userId"],
});