Scheduling infrastructure for absolutely everyone.
debug logs added
Syed Ali Shahbazecce02ebbf60
diff --git a/lib/utils/sendPayload.ts b/lib/utils/sendPayload.tsindex f40c0ad7436..a6234a1d372 100644--- a/lib/utils/sendPayload.ts+++ b/lib/utils/sendPayload.ts@@ -18,6 +18,7 @@ function jsonParse(jsonString: string) {return JSON.parse(jsonString);} catch (e) {// don't do anything.+ console.error(`error jsonParsing in sendPayload`);}return false;}diff --git a/pages/api/bookings/index.ts b/pages/api/bookings/index.tsindex 3336098d577..e31a0178014 100644--- a/pages/api/bookings/index.ts+++ b/pages/api/bookings/index.ts@@ -94,6 +94,7 @@ async function createOrlistAllBookings(.catch((e: Error) => {console.error(`Event type with ID: ${booking.eventTypeId} not found`, e);});+ console.log(`eventType: ${eventType}`);const evt = {type: eventType?.title || booking.title,title: booking.title,@@ -117,16 +118,20 @@ async function createOrlistAllBookings(uid: booking.uid,metadata: {},};+ console.log(`evt: ${evt}`);// Send Webhook call if hooked to BOOKING_CREATEDconst triggerEvent = WebhookTriggerEvents.BOOKING_CREATED;+ console.log(`Trigger Event: ${triggerEvent}`);const subscriberOptions = {userId,eventTypeId: booking.eventTypeId as number,triggerEvent,};+ console.log(`subscriberOptions: ${subscriberOptions}`);const subscribers = await getWebhooks(subscriberOptions);+ console.log(`subscribers: ${subscribers}`);const bookingId = booking?.id;const promises = subscribers.map((sub) =>sendPayload(triggerEvent, new Date().toISOString(), sub, {