From a3722bc86ca2e130d1e20b14dcad03383ee1cd3e Mon Sep 17 00:00:00 2001 From: lucia <51058748+lucia-gomez@users.noreply.github.com> Date: Fri, 12 Apr 2024 15:54:29 -0400 Subject: [PATCH 1/2] don't auto approve any event > 4hrs --- .../src/client/routes/booking/hooks/useSubmitBooking.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/media_commons_booking_app/src/client/routes/booking/hooks/useSubmitBooking.tsx b/media_commons_booking_app/src/client/routes/booking/hooks/useSubmitBooking.tsx index 15d0a205..9fafc561 100644 --- a/media_commons_booking_app/src/client/routes/booking/hooks/useSubmitBooking.tsx +++ b/media_commons_booking_app/src/client/routes/booking/hooks/useSubmitBooking.tsx @@ -127,8 +127,12 @@ export default function useSubmitBooking(): [ ]); const isAutoApproval = (selectedRoomIds: string[], data: Booking) => { + const startDate = new Date(data.startDate); + const endDate = new Date(data.endDate); + const duration = endDate.getTime() - startDate.getTime(); // If the selected rooms are all instant approval rooms and the user does not need catering, and hire security, and room setup, then it is auto-approval. return ( + duration <= 3.6e6 * 4 && // <= 4 hours selectedRoomIds.every((r) => INSTANT_APPROVAL_ROOMS.includes(r)) && data['catering'] === 'no' && data['hireSecurity'] === 'no' && From cd2fcecc79986e4aa3092a08b7e642517ff555e7 Mon Sep 17 00:00:00 2001 From: lucia <51058748+lucia-gomez@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:40:06 -0400 Subject: [PATCH 2/2] fix safety training typo --- .../src/client/routes/booking/components/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media_commons_booking_app/src/client/routes/booking/components/Header.tsx b/media_commons_booking_app/src/client/routes/booking/components/Header.tsx index da664d3c..856e39e8 100644 --- a/media_commons_booking_app/src/client/routes/booking/components/Header.tsx +++ b/media_commons_booking_app/src/client/routes/booking/components/Header.tsx @@ -23,7 +23,7 @@ export const Header = () => {
{!isSafetyTrained && (

- You have to take safty training before booking! + You have to take safety training before booking!

)} {isBanned &&

You're banned

}