first commit
This commit is contained in:
21
calcom/packages/app-store/_utils/invalidateCredential.ts
Normal file
21
calcom/packages/app-store/_utils/invalidateCredential.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user