From 0746b1e3723a0011afb8f4ecb279713c51af4f0b Mon Sep 17 00:00:00 2001 From: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Date: Fri, 28 Oct 2022 11:09:15 +0200 Subject: [PATCH] Fix Zapier sample data and payload (#5241) * fix zapier example and payload * fix type error Co-authored-by: CarinaWolli Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../app-store/zapier/api/subscriptions/listBookings.ts | 10 +++++++++- packages/features/webhooks/lib/sendPayload.tsx | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/app-store/zapier/api/subscriptions/listBookings.ts b/packages/app-store/zapier/api/subscriptions/listBookings.ts index 981e03d8ba..f6771b57e8 100644 --- a/packages/app-store/zapier/api/subscriptions/listBookings.ts +++ b/packages/app-store/zapier/api/subscriptions/listBookings.ts @@ -33,7 +33,15 @@ async function handler(req: NextApiRequest, res: NextApiResponse) { location: true, cancellationReason: true, status: true, - user: true, + user: { + select: { + username: true, + name: true, + email: true, + timeZone: true, + locale: true, + }, + }, eventType: { select: { title: true, diff --git a/packages/features/webhooks/lib/sendPayload.tsx b/packages/features/webhooks/lib/sendPayload.tsx index e396f36258..8da4ac56bb 100644 --- a/packages/features/webhooks/lib/sendPayload.tsx +++ b/packages/features/webhooks/lib/sendPayload.tsx @@ -36,6 +36,14 @@ function getZapierPayload(data: CalendarEvent & EventTypeInfo & { status?: strin endTime: data.endTime, location: location, status: data.status, + cancellationReason: data.cancellationReason, + user: { + username: data.organizer.username, + name: data.organizer.name, + email: data.organizer.email, + timeZone: data.organizer.timeZone, + locale: data.organizer.locale, + }, eventType: { title: data.eventTitle, description: data.eventDescription,