perf: Insights - put teamId filter first (#16581)
This commit is contained in:
@@ -209,18 +209,18 @@ export const insightsRouter = router({
|
||||
whereConditional = {
|
||||
...whereConditional,
|
||||
OR: [
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
{
|
||||
teamId: {
|
||||
in: [ctx.user.organizationId, ...teamsFromOrg.map((t) => t.id)],
|
||||
},
|
||||
isTeamBooking: true,
|
||||
},
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -436,18 +436,18 @@ export const insightsRouter = router({
|
||||
|
||||
whereConditional = {
|
||||
OR: [
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
{
|
||||
teamId: {
|
||||
in: [ctx.user.organizationId, ...teamsFromOrg.map((t) => t.id)],
|
||||
},
|
||||
isTeamBooking: true,
|
||||
},
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
@@ -614,18 +614,18 @@ export const insightsRouter = router({
|
||||
bookingWhere = {
|
||||
...bookingWhere,
|
||||
OR: [
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
{
|
||||
teamId: {
|
||||
in: [ctx.user.organizationId, ...teamsFromOrg.map((t) => t.id)],
|
||||
},
|
||||
isTeamBooking: true,
|
||||
},
|
||||
{
|
||||
userId: {
|
||||
in: userIdsFromOrg,
|
||||
},
|
||||
isTeamBooking: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user