* auto constent for trusted clients * add loading state --------- Co-authored-by: CarinaWolli <wollencarina@gmail.com>
26 lines
518 B
TypeScript
26 lines
518 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.findUnique({
|
|
where: {
|
|
clientId,
|
|
},
|
|
select: {
|
|
clientId: true,
|
|
redirectUri: true,
|
|
name: true,
|
|
logo: true,
|
|
isTrusted: true,
|
|
},
|
|
});
|
|
return client;
|
|
};
|