Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Keith Williams <keithwillcode@gmail.com>
22 lines
530 B
TypeScript
22 lines
530 B
TypeScript
import { prisma } from "@calcom/prisma";
|
|
|
|
import type { TrpcSessionUser } from "../../../trpc";
|
|
import type { CheckGlobalKeysSchemaType } from "./checkGlobalKeys.schema";
|
|
|
|
type checkForGlobalKeys = {
|
|
ctx: {
|
|
user: NonNullable<TrpcSessionUser>;
|
|
};
|
|
input: CheckGlobalKeysSchemaType;
|
|
};
|
|
|
|
export const checkForGlobalKeysHandler = async ({ input }: checkForGlobalKeys) => {
|
|
const appIsGloballyInstalled = await prisma.app.findUnique({
|
|
where: {
|
|
slug: input.slug,
|
|
},
|
|
});
|
|
|
|
return !!appIsGloballyInstalled;
|
|
};
|