chore: Refactor feature flags (#13734)
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
1 parent
75d5576e17
commit
83ceb46cca
11 files changed
+85
-38
No files matched your search
@@ -1,14 +1,14 @@
|
||||
import type { GetServerSidePropsContext } from "next";
|
||||
|
||||
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
||||
import { getFeatureFlagMap } from "@calcom/features/flags/server/utils";
|
||||
import { getFeatureFlag } from "@calcom/features/flags/server/utils";
|
||||
import { MembershipRole } from "@calcom/prisma/client";
|
||||
|
||||
export const getServerSideProps = async ({ req, res }: GetServerSidePropsContext) => {
|
||||
const prisma = await import("@calcom/prisma").then((mod) => mod.default);
|
||||
const flags = await getFeatureFlagMap(prisma);
|
||||
const organizationsEnabled = await getFeatureFlag(prisma, "organizations");
|
||||
// Check if organizations are enabled
|
||||
if (flags["organizations"] !== true) {
|
||||
if (!organizationsEnabled) {
|
||||
return {
|
||||
notFound: true,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user