From c4bfe987988ec82581beab90c548d28c744128e5 Mon Sep 17 00:00:00 2001 From: aar2dee2 <85004512+aar2dee2@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:14:34 +0530 Subject: [PATCH] fix param name in deleteSubcription --- packages/app-store/_utils/nodeScheduler.ts | 8 ++++---- .../make/api/subscriptions/deleteSubscription.ts | 2 +- .../zapier/api/subscriptions/deleteSubscription.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/app-store/_utils/nodeScheduler.ts b/packages/app-store/_utils/nodeScheduler.ts index 6bad273802..897885c6f4 100644 --- a/packages/app-store/_utils/nodeScheduler.ts +++ b/packages/app-store/_utils/nodeScheduler.ts @@ -67,11 +67,11 @@ export async function addSubscription({ export async function deleteSubscription({ appApiKey, webhookId, - appName, + appId, }: { appApiKey: ApiKey; webhookId: string; - appName: string; + appId: string; }) { try { const webhook = await prisma.webhook.findFirst({ @@ -94,7 +94,7 @@ export async function deleteSubscription({ }); for (const booking of bookingsWithScheduledJobs) { const updatedScheduledJobs = booking.scheduledJobs.filter( - (scheduledJob) => scheduledJob !== `${appName}_${webhook.id}` + (scheduledJob) => scheduledJob !== `${appId}_${webhook.id}` ); await prisma.booking.update({ where: { @@ -118,7 +118,7 @@ export async function deleteSubscription({ return deleteWebhook; } catch (err) { return console.error( - `Error deleting subscription for user ${appApiKey.userId}, webhookId ${webhookId}, appName ${appName}` + `Error deleting subscription for user ${appApiKey.userId}, webhookId ${webhookId}, appId ${appId}` ); } } diff --git a/packages/app-store/make/api/subscriptions/deleteSubscription.ts b/packages/app-store/make/api/subscriptions/deleteSubscription.ts index 7cab2c8764..ce8d87e528 100644 --- a/packages/app-store/make/api/subscriptions/deleteSubscription.ts +++ b/packages/app-store/make/api/subscriptions/deleteSubscription.ts @@ -26,7 +26,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { const deleteEventSubscription = await deleteSubscription({ appApiKey: validKey, webhookId: id, - appName: "make", + appId: "make", }); if (!deleteEventSubscription) { diff --git a/packages/app-store/zapier/api/subscriptions/deleteSubscription.ts b/packages/app-store/zapier/api/subscriptions/deleteSubscription.ts index 1e17732cf5..1433fa83af 100644 --- a/packages/app-store/zapier/api/subscriptions/deleteSubscription.ts +++ b/packages/app-store/zapier/api/subscriptions/deleteSubscription.ts @@ -26,7 +26,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { const deleteEventSubscription = await deleteSubscription({ appApiKey: validKey, webhookId: id, - appName: "zapier", + appId: "zapier", }); if (!deleteEventSubscription) {