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
fix/replacing bookingAttendees for bookingUid #8997
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -72,7 +72,7 @@ const AvailableTimes: FC<AvailableTimesProps> = ({ | |||
slotUtcStartDate: slot.time, | |||
eventTypeId, | |||
slotUtcEndDate: dayjs(slot.time).utc().add(duration, "minutes").format(), | |||
bookingAttendees: bookingAttendees || undefined, | |||
bookingUid: slot.bookingUid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of sending total bookingAttendees we send currentSlotBooking UID
@@ -40,8 +40,13 @@ export const reserveSlotHandler = async ({ ctx, input }: ReserveSlotOptions) => | |||
// If this is a seated event then don't reserve a slot | |||
if (eventType.seatsPerTimeSlot) { | |||
// Check to see if this is the last attendee | |||
if (bookingAttendees) { | |||
const seatsLeft = eventType.seatsPerTimeSlot - bookingAttendees; | |||
const bookingWithAttendees = await prisma.booking.findFirst({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fetch current attendees on server
@@ -72,7 +72,7 @@ const AvailableTimes: FC<AvailableTimesProps> = ({ | |||
slotUtcStartDate: slot.time, | |||
eventTypeId, | |||
slotUtcEndDate: dayjs(slot.time).utc().add(duration, "minutes").format(), | |||
bookingAttendees: bookingAttendees || undefined, | |||
bookingUid: slot.bookingUid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of sending total bookingAttendees we send currentSlotBooking UID
@alannnc What is the purpose of this refactor? Does it solve any bug? |
📦 Next.js Bundle Analysis for @calcom/webThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
Current Playwright Test Results Summary✅ 114 Passing - Run may still be in progress, this comment will be updated as current testing workflow or job completes... (Last updated on 05/19/2023 07:14:28pm UTC) Run DetailsRunning Workflow PR Update on Github Actions Commit: 0deca26 Started: 05/19/2023 07:04:09pm UTC
|
Test Case | Last 7 days Failures | Last 7 days Flakes |
---|---|---|
Booking with Seats -- new-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1 • Initial Attempt |
0% (0)0 / 265 runsfailed over last 7 days |
83.77% (222)222 / 265 runsflaked over last 7 days |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks a lot @alannnc!
@roae The main reason for this change is because I asked it. Before this change this reserve mutation expected to have the data of the bookingattendees client side. That means that the booker needs to do an additional query, only to then send it to the backend and not use it themselves. So imo it made more sense to query this data directly in the backend, which is faster as well. That way I didn't need to add an additional query to the new booker.
What does this PR do?
Environment: Staging(main branch)
Type of change
How should this be tested?
Checklist