* chore: Remove all code related to the old cache system * Removed some redundant tests, some type fixes * Further type fixes * More type fixes re. tests * Next iteration, couple of fixes remaining * Remove cache from CredentialActionsDropdown * Fix tests by mocking credential, instead of db queries * Remove Cache DI wiring from v2 * Make sure apiv2 build passes * Remove another cache cron * Remove old tokens for calendar-cache v1
23 lines
580 B
TypeScript
23 lines
580 B
TypeScript
import type { PrismaClient } from "@calcom/prisma";
|
|
import type { TAdminToggleFeatureFlagSchema } from "./toggleFeatureFlag.schema";
|
|
|
|
type GetOptions = {
|
|
ctx: {
|
|
user: { id: number };
|
|
prisma: PrismaClient;
|
|
};
|
|
input: TAdminToggleFeatureFlagSchema;
|
|
};
|
|
|
|
export const toggleFeatureFlagHandler = async (opts: GetOptions) => {
|
|
const { ctx, input } = opts;
|
|
const { prisma, user } = ctx;
|
|
const { slug, enabled } = input;
|
|
return prisma.feature.update({
|
|
where: { slug },
|
|
data: { enabled, updatedBy: user.id },
|
|
});
|
|
};
|
|
|
|
export default toggleFeatureFlagHandler;
|