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

Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
Cao HoangandUdit Takkar authored and GitHub committed 2024-12-30 21:15:27 +00:00
1 parent 116c765c36
commit d8027fe248
1 file changed
+1 -3
@@ -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"],
});