fix: delete related api key when make.com app is disconnect (#23539)
* add * fix: delete api keys when deleted * Update NavigationItem.tsx
This commit is contained in:
@@ -390,18 +390,19 @@ const handleDeleteCredential = async ({
|
||||
}
|
||||
}
|
||||
|
||||
// if zapier get disconnected, delete zapier apiKey, delete zapier webhooks and cancel all scheduled jobs from zapier
|
||||
if (credential.app?.slug === "zapier") {
|
||||
// if zapier or make get disconnected, delete its apiKey, delete its webhooks and cancel all scheduled jobs
|
||||
if (credential.app?.slug === "zapier" || credential.app?.slug === "make") {
|
||||
const ownerFilter = teamId ? { teamId } : { userId };
|
||||
await prisma.apiKey.deleteMany({
|
||||
where: {
|
||||
userId: userId,
|
||||
appId: "zapier",
|
||||
...ownerFilter,
|
||||
appId: credential.app.slug,
|
||||
},
|
||||
});
|
||||
await prisma.webhook.deleteMany({
|
||||
where: {
|
||||
userId: userId,
|
||||
appId: "zapier",
|
||||
...ownerFilter,
|
||||
appId: credential.app.slug,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user