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:
Anik Dhabal Babu
2025-09-03 12:56:38 +00:00
committed by GitHub
parent afb54ca048
commit 216fb2141b
@@ -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,
},
});