* Add example app to test credential sync * Fixes * Changes to normalize flow of GoogleCalendar and Zoom * Add unit tests * PR Feedback * credential-sync-more-tests-and-more-apps * Fix yarn.lock * Clear cache * Add test * Fix yarn.lock * Fix 204 handling * Fix yarn.lock --------- Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
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,
|
|
},
|
|
});
|
|
};
|