2
0
Files
cal/calcom/packages/trpc/server/routers/viewer/oAuth/getClient.handler.ts
2024-08-09 00:39:27 +02:00

25 lines
494 B
TypeScript

import { prisma } from "@calcom/prisma";
import type { TGetClientInputSchema } from "./getClient.schema";
type GetClientOptions = {
input: TGetClientInputSchema;
};
export const getClientHandler = async ({ input }: GetClientOptions) => {
const { clientId } = input;
const client = await prisma.oAuthClient.findFirst({
where: {
clientId,
},
select: {
clientId: true,
redirectUri: true,
name: true,
logo: true,
},
});
return client;
};