Show success page if booking was deleted on calendar (#2808)

* Add exception to 410

* Fix type error

* Add GoogelCalError type
pull/2850/head
Joe Au-Yeung 2022-05-18 11:34:21 -04:00 committed by zomars
parent 80954aa866
commit afafd45223
1 changed files with 6 additions and 1 deletions

View File

@ -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);
}