Files
calendar/packages/trpc/server/routers/viewer/admin/toggleFeatureFlag.handler.ts
T
Alex van AndelandGitHub ae7fd0cae2 refactor: Remove all code related to the old cache system (#25284)
* 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
2025-11-20 18:02:18 +02:00

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;