fix: slug value in webhook payload (#12290)

Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-11-20 15:39:21 +00:00
1 parent 9eb2ae470c
commit 77fa3702db
7 files changed
+12 -12

No files matched your search

@@ -224,7 +224,7 @@ async function handler(req: CustomRequest) {
const evt: CalendarEvent = {
title: bookingToDelete?.title,
type: (bookingToDelete?.eventType?.title as string) || bookingToDelete?.title,
type: bookingToDelete?.eventType?.slug as string,
description: bookingToDelete?.description || "",
customInputs: isPrismaObjOrUndefined(bookingToDelete.customInputs),
...getCalEventResponses({
@@ -504,7 +504,7 @@ async function handler(req: CustomRequest) {
// Avoiding taking care of recurrence for now as Payments are not supported with Recurring Events at the moment
if (bookingToDelete && bookingToDelete.paid) {
const evt: CalendarEvent = {
type: bookingToDelete?.eventType?.title as string,
type: bookingToDelete?.eventType?.slug as string,
title: bookingToDelete.title,
description: bookingToDelete.description ?? "",
customInputs: isPrismaObjOrUndefined(bookingToDelete.customInputs),
@@ -1103,7 +1103,7 @@ async function handler(
let evt: CalendarEvent = {
bookerUrl: await getBookerUrl(organizerUser),
type: eventType.title,
type: eventType.slug,
title: getEventName(eventNameObject), //this needs to be either forced in english, or fetched for each attendee and organizer separately
description: eventType.description,
additionalNotes,
+1 -1
View File
@@ -85,7 +85,7 @@ export async function getBooking(bookingId: number) {
const attendeesList = await Promise.all(attendeesListPromises);
const selectedDestinationCalendar = booking.destinationCalendar || user.destinationCalendar;
const evt: CalendarEvent = {
type: booking.title,
type: booking?.eventType?.slug as string,
title: booking.title,
description: booking.description || undefined,
startTime: booking.startTime.toISOString(),
@@ -56,6 +56,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
teamId: true,
recurringEvent: true,
title: true,
slug: true,
requiresConfirmation: true,
currency: true,
length: true,
@@ -151,7 +152,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
const attendeesList = await Promise.all(attendeesListPromises);
const evt: CalendarEvent = {
type: booking.eventType?.title || booking.title,
type: booking?.eventType?.slug as string,
title: booking.title,
description: booking.description,
// TODO: Remove the usage of `bookingFields` in computing responses. We can do that by storing `label` with the response. Also, this would allow us to correctly show the label for a field even after the Event Type has been deleted.
@@ -177,7 +177,7 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
builder.init({
title: bookingToReschedule.title,
bookerUrl: await getBookerUrl(user),
type: event && event.title ? event.title : bookingToReschedule.title,
type: event && event.slug ? event.slug : bookingToReschedule.title,
startTime: bookingToReschedule.startTime.toISOString(),
endTime: bookingToReschedule.endTime.toISOString(),
attendees: usersToPeopleType(
@@ -236,7 +236,7 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
const evt: CalendarEvent = {
title: bookingToReschedule?.title,
type: event && event.title ? event.title : bookingToReschedule.title,
type: event && event.slug ? event.slug : bookingToReschedule.title,
description: bookingToReschedule?.description || "",
customInputs: isPrismaObjOrUndefined(bookingToReschedule.customInputs),
...getCalEventResponses({