2
0
Files

23 lines
487 B
TypeScript
Raw Permalink Normal View History

2024-08-09 00:39:27 +02:00
import type z from "zod";
import prisma from "@calcom/prisma";
import type { OAuth2UniversalSchemaWithCalcomBackwardCompatibility } from "./universalSchema";
export const updateTokenObject = async ({
tokenObject,
credentialId,
}: {
tokenObject: z.infer<typeof OAuth2UniversalSchemaWithCalcomBackwardCompatibility>;
credentialId: number;
}) => {
await prisma.credential.update({
where: {
id: credentialId,
},
data: {
key: tokenObject,
},
});
};