* 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>
22 lines
469 B
TypeScript
22 lines
469 B
TypeScript
import prisma from "@calcom/prisma";
|
|
import type { CredentialPayload } from "@calcom/types/Credential";
|
|
|
|
export const invalidateCredential = async (credentialId: CredentialPayload["id"]) => {
|
|
const credential = await prisma.credential.findUnique({
|
|
where: {
|
|
id: credentialId,
|
|
},
|
|
});
|
|
|
|
if (credential) {
|
|
await prisma.credential.update({
|
|
where: {
|
|
id: credentialId,
|
|
},
|
|
data: {
|
|
invalid: true,
|
|
},
|
|
});
|
|
}
|
|
};
|