From 24e1229baf16eb9aaca8cb796b19834e885346af Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 21 Jun 2024 20:09:57 +0200 Subject: [PATCH] Add a button to validate or reject the reservation --- .../AccommodationsReservationsRoute.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx index f36211c..9410839 100644 --- a/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx +++ b/geneit_app/src/routes/family/accommodations/AccommodationsReservationsRoute.tsx @@ -6,6 +6,7 @@ import listPlugin from "@fullcalendar/list"; import FullCalendar from "@fullcalendar/react"; import DeleteIcon from "@mui/icons-material/Delete"; import EditIcon from "@mui/icons-material/Edit"; +import RuleIcon from "@mui/icons-material/Rule"; import { Alert, Avatar, @@ -173,6 +174,10 @@ export function AccommodationsReservationsRoute(): React.ReactElement { }); }; + const validateReservation = async (r: AccommodationReservation) => { + // TODO + }; + const changeReservation = async (r: AccommodationReservation) => { try { const ac = accommodations.accommodations.get(r.accommodation_id); @@ -466,9 +471,24 @@ export function AccommodationsReservationsRoute(): React.ReactElement { + {activeEvent?.accommodation.need_validation && + family.family.is_admin && ( + + + validateReservation(activeEvent?.reservation) + } + > + + + + )} {user.user.id === activeEvent?.reservation.user_id && ( <> - + changeReservation(activeEvent?.reservation)