feat: add booking edit modal for /today page with service management
Replace placeholder BookingModal on the Next Appointment edit button with a dedicated EditBookingModal that allows admins to add, remove, and override services on an active booking. Includes backend PUT endpoint with overlap detection and full test suite (20 tests).
This commit is contained in:
@@ -9,10 +9,11 @@
|
||||
|
||||
interface Props {
|
||||
openBookingModal: (bookingId: string) => void;
|
||||
openEditBookingModal: (bookingId: string, nextAppointmentStart?: string | null) => void;
|
||||
openUserModal: (userId: string) => void;
|
||||
}
|
||||
|
||||
let { openBookingModal, openUserModal }: Props = $props();
|
||||
let { openBookingModal, openEditBookingModal, openUserModal }: Props = $props();
|
||||
|
||||
type Booking = {
|
||||
id: string;
|
||||
@@ -153,7 +154,7 @@
|
||||
|
||||
function handleEdit() {
|
||||
if (currentAppointment) {
|
||||
openBookingModal(currentAppointment.id);
|
||||
openEditBookingModal(currentAppointment.id, nextAppointment?.start_time ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user