Skip to content

Commit

Permalink
Merge branch 'lucia/dev' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
lucia-gomez committed Apr 15, 2024
2 parents 988ed3e + cd2fcec commit 97fff44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Header = () => {
<div>
{!isSafetyTrained && (
<p className="text-red-500 text-bold ">
You have to take safty training before booking!
You have to take safety training before booking!
</p>
)}
{isBanned && <p className="text-red-500 text-bold ">You're banned </p>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down

0 comments on commit 97fff44

Please sign in to comment.