Skip to content

useReservationReschedule ​

When the config contains reservationUuid, fetchRemoteConfiguration returns the matching reservation. Store it here so the UI can show the current booking and reschedule() knows which reservation to move.

ts
import { useReservationReschedule } from "@zaptime/core";

const { reservation, setSelectedReservation } = useReservationReschedule(calendarId?);

Set selected reservation ​

Called during initialization.

ts
if (remote.reservation) setSelectedReservation(remote.reservation);

Reservation ​

ts
type Reservation = {
  uuid: string;
  start: string; // ISO 8601
  end: string;
  email: string;
  firstName?: string;
  lastName?: string;
  location?: Location;
  status: string;
};

reservation.value; // Reservation | undefined

reservation.value !== undefined is the signal that the calendar is in reschedule mode: show old → new time instead of the booking form and call reschedule(calendarId) on submit. See Rescheduling.