From afafd452232f7ca2b706c5b150f1e6ff5e9cab0d Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Wed, 18 May 2022 11:34:21 -0400 Subject: [PATCH] Show success page if booking was deleted on calendar (#2808) * Add exception to 410 * Fix type error * Add GoogelCalError type --- packages/app-store/googlecalendar/lib/CalendarService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/app-store/googlecalendar/lib/CalendarService.ts b/packages/app-store/googlecalendar/lib/CalendarService.ts index 8471ab0c6d..842b741c35 100644 --- a/packages/app-store/googlecalendar/lib/CalendarService.ts +++ b/packages/app-store/googlecalendar/lib/CalendarService.ts @@ -18,6 +18,10 @@ import type { PartialReference } from "@calcom/types/EventManager"; import getAppKeysFromSlug from "../../_utils/getAppKeysFromSlug"; +interface GoogleCalError extends Error { + code?: number; +} + export default class GoogleCalendarService implements Calendar { private url = ""; private integrationName = ""; @@ -229,8 +233,9 @@ export default class GoogleCalendarService implements Calendar { sendNotifications: true, sendUpdates: "all", }, - function (err, event) { + function (err: GoogleCalError | null, event) { if (err) { + if (err.code === 410) resolve(); console.error("There was an error contacting google calendar service: ", err); return reject(err); }