fix: booker atom seated events reservation (#21339)

* fix: reserving first seated booking slot

* fix: input type in useReserveSlot

* fix: handleReserveSlot submit bookingUid to api

* null -> undefined

* dont touch web app
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2025-05-16 14:32:06 +02:00
1 parent a5b684af1f
commit 86918b03cf
5 files changed
+12 -8

No files matched your search

@@ -5,7 +5,7 @@ import type {
ApiResponse,
ApiErrorResponse,
ApiSuccessResponse,
ReserveSlotInput,
ReserveSlotInput_2024_04_15,
} from "@calcom/platform-types";
import http from "../lib/http";
@@ -24,8 +24,8 @@ export const useReserveSlot = (
},
}
) => {
const reserveSlot = useMutation<ApiResponse<string>, unknown, ReserveSlotInput>({
mutationFn: (props: ReserveSlotInput) => {
const reserveSlot = useMutation<ApiResponse<string>, unknown, ReserveSlotInput_2024_04_15>({
mutationFn: (props: ReserveSlotInput_2024_04_15) => {
return http.post<ApiResponse<string>>("/slots/reserve", props).then((res) => {
if (res.data.status === SUCCESS_STATUS) {
return res.data;
@@ -52,6 +52,8 @@ export const useSlots = (
onError: onReserveSlotError,
});
const seatedEventData = useBookerStore((state) => state.seatedEventData);
const removeSelectedSlot = useDeleteSelectedSlot({
onSuccess: onDeleteSlotSuccess,
onError: onDeleteSlotError,
@@ -78,6 +80,7 @@ export const useSlots = (
.add(selectedDuration || event.data.length, "minutes")
.format(),
_isDryRun: isBookingDryRun,
bookingUid: seatedEventData.bookingUid || undefined,
});
}
};
@@ -132,9 +132,6 @@ export default function Bookings(props: { calUsername: string; calEmail: string
: { username: props.calUsername })}
hostsLimit={3}
allowUpdatingUrlParams={true}
handleSlotReservation={(timeslot) => {
console.log("Selected timeslot:", timeslot);
}}
/>
</>
)}