* feat: allows forcing/skipping calendar cache serving Signed-off-by: Omar López <zomars@me.com> * Update features.repository.ts * Added to HNB * type fixes * Update packages/prisma/migrations/20241216000000_add_calendar_cache_serve/migration.sql Co-authored-by: Keith Williams <keithwillcode@gmail.com> * Update packages/prisma/zod-utils.ts Co-authored-by: Keith Williams <keithwillcode@gmail.com> * Update selectedCalendar.ts --------- Signed-off-by: Omar López <zomars@me.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com>
9 lines
418 B
TypeScript
9 lines
418 B
TypeScript
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
|
|
|
|
export async function getShouldServeCache(shouldServeCache?: boolean | undefined, teamId?: number) {
|
|
if (typeof shouldServeCache === "boolean") return shouldServeCache;
|
|
if (!teamId) return undefined;
|
|
const featureRepo = new FeaturesRepository();
|
|
return await featureRepo.checkIfTeamHasFeature(teamId, "calendar-cache-serve");
|
|
}
|