Skip to content

Reduce payload size #21093

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions packages/features/bookings/lib/handleNewBooking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ type BookingDataSchemaGetter =
| typeof import("@calcom/features/bookings/lib/getBookingDataSchemaForApi").default;

type CreatedBooking = Booking & { appsStatus?: AppsStatus[]; paymentUid?: string; paymentId?: number };

type ReturnTypeCreateBooking = Awaited<ReturnType<typeof createBooking>>;
const buildDryRunBooking = ({
eventTypeId,
organizerUser,
Expand Down Expand Up @@ -193,8 +193,11 @@ const buildDryRunBooking = ({
isManagedEventType: boolean;
}) => {
const sanitizedOrganizerUser = {
...organizerUser,
credentials: undefined,
id: organizerUser.id,
name: organizerUser.name,
username: organizerUser.username,
email: organizerUser.email,
timeZone: organizerUser.timeZone,
};
const booking = {
id: -101,
Expand All @@ -210,8 +213,6 @@ const buildDryRunBooking = ({
createdAt: new Date(),
updatedAt: new Date(),
attendees: [],
references: [],
payment: [],
oneTimePassword: null,
smsReminderNumber: null,
metadata: {},
Expand All @@ -222,33 +223,28 @@ const buildDryRunBooking = ({
responses: null,
location: null,
paid: false,
destinationCalendar: null,
cancellationReason: null,
rejectionReason: null,
dynamicEventSlugRef: null,
dynamicGroupSlugRef: null,
rescheduledFrom: null,
fromReschedule: null,
recurringEventId: null,
seatsReferences: [],
workflowReminders: [],
scheduledJobs: [],
rescheduledTo: null,
rescheduledBy: null,
destinationCalendarId: null,
reassignReason: null,
reassignById: null,
rescheduled: false,
confirmed: false,
isRecurringEvent: false,
isRecorded: false,
iCalSequence: 0,
rating: null,
ratingFeedback: null,
noShowHost: null,
cancelledBy: null,
creationSource: CreationSource.WEBAPP,
} as CreatedBooking;
references: [],
payment: [],
} satisfies ReturnTypeCreateBooking;

/**
* Troubleshooting data
Expand Down
Loading