23 lines
487 B
TypeScript
23 lines
487 B
TypeScript
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,
|
|
},
|
|
});
|
|
};
|