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

} 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' &&