Skip to content

Scheduling infrastructure for absolutely everyone.

hotfix (#19266)

Syed Ali Shahbaz8ada940dc73c
diff --git a/packages/features/insights/server/trpc-router.ts b/packages/features/insights/server/trpc-router.ts
index 88788ec506f..5f1280fa28a 100644
--- a/packages/features/insights/server/trpc-router.ts
+++ b/packages/features/insights/server/trpc-router.ts
@@ -71,7 +71,22 @@ const buildBaseWhereCondition = async ({
id: true,
},
});
- if (teamsFromOrg.length === 0) return { whereCondition, isEmptyResponse: true };
+
+ if (teamsFromOrg.length === 0) {
+ return {
+ whereCondition: {
+ ...whereCondition,
+ OR: [
+ ...(whereCondition.OR ?? []),
+ {
+ teamId: ctx.userOrganizationId,
+ isTeamBooking: true,
+ },
+ ],
+ },
+ isEmptyResponse: true,
+ };
+ }
const teamConditional = {
id: {