+1








30ba168fc3
Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: Omar López <zomars@me.com> Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Alex van Andel <me@alexvanandel.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Benny Joo <sldisek783@gmail.com> Co-authored-by: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Co-authored-by: Gergő Móricz <mo.geryy@gmail.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com>
15 lines
429 B
TypeScript
15 lines
429 B
TypeScript
import type { PrismaClient } from "@calcom/prisma";
|
|
|
|
import type { AppFlags } from "../config";
|
|
|
|
export async function getFeatureFlagMap(prisma: PrismaClient) {
|
|
const flags = await prisma.feature.findMany({
|
|
orderBy: { slug: "asc" },
|
|
cacheStrategy: { swr: 300, ttl: 300 },
|
|
});
|
|
return flags.reduce((acc, flag) => {
|
|
acc[flag.slug as keyof AppFlags] = flag.enabled;
|
|
return acc;
|
|
}, {} as Partial<AppFlags>);
|
|
}
|