diff --git a/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx b/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx index e3169437..f681a6ac 100644 --- a/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx +++ b/media_commons_booking_app/src/client/routes/booking/components/FormInput.tsx @@ -77,7 +77,6 @@ const FormInput = ({ handleParentSubmit }) => { const onSubmit: SubmitHandler = (data) => { const dumpMediaServices = data.mediaServices || []; - //@ts-ignore data.mediaServices = Array.isArray(dumpMediaServices) ? dumpMediaServices.join(', ') : dumpMediaServices; @@ -93,15 +92,7 @@ const FormInput = ({ handleParentSubmit }) => { }; return ( -
{ - // e.preventDefault(); - // const values = Object.values(data); - // handleParentSubmit(values, data); - //}} - onSubmit={handleSubmit(onSubmit)} - > + {userEmail == null && (
- {watch('mediaServices') !== undefined && ( + {watch('mediaServices').length > 0 && (

+ {errors.mediaServicesDetails && ( + + )} 0, + })} />
)} 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 f45ff3a2..77b0d80b 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 @@ -117,13 +117,13 @@ export default function useSubmitBooking(): [ formatDate(new Date()), ]); - const isAutoApproval = (selectedRoomIds, data) => { + const isAutoApproval = (selectedRoomIds: string[], data: Booking) => { // 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 ( selectedRoomIds.every((r) => INSTANT_APPROVAL_ROOMS.includes(r)) && data['catering'] === 'no' && data['hireSecurity'] === 'no' && - data['mediaServices'] === '' && + data['mediaServices'].length === 0 && data['roomSetup'] === 'no' ); };