* init migration and fix name for team event availability toggle * show and save restriction schedule * better naming around * fix loading stored restricted schedule instead of default * add the booker timezone checkbox in the form * restriction schedule application babbbyyyy * remove logs * test * typefix * fix * fix?? * fix??? * --- * typefix * functional fix * restrictionschedule logic --1 * timezone adjustment for regular constraint * noice * test suite for restrictionSchedule * auth restrictionschedule for eventtype * remove unnecessary comments * index * type fix * add concurrent * resolve change request * fix unauth erro * type fix * schedule select extracted from select * revert * fix auth vulnerabililty * fix e22 * chore: hide restriction schedule on platform * init review feedback resolutions * fixes * fix type * multiple windows of recurring rule-same day * team feature flag * fix type err * fix type * improvements * fix test * improve * fix error propagation * fix unused var lint * cleanup and using buildDateRanges * travel schedule inclusion * address comment --------- Co-authored-by: supalarry <laurisskraucis@gmail.com>
16 lines
589 B
TypeScript
16 lines
589 B
TypeScript
import { FeaturesRepository } from "@calcom/features/flags/features.repository";
|
|
|
|
/**
|
|
* Checks if the restriction schedule feature is enabled for a team
|
|
* @param teamId - The team ID to check
|
|
* @returns Promise<boolean> - True if the feature is enabled, false otherwise
|
|
*/
|
|
export async function isRestrictionScheduleEnabled(teamId?: number): Promise<boolean> {
|
|
if (!teamId) {
|
|
return false; // Personal events don't have restriction schedules
|
|
}
|
|
|
|
const featureRepo = new FeaturesRepository();
|
|
return await featureRepo.checkIfTeamHasFeature(teamId, "restriction-schedule");
|
|
}
|