Skip to content

Commit

Permalink
Merge pull request #193 from ITPNYU/hotfix/safety_training
Browse files Browse the repository at this point in the history
Hotfix/safety training
  • Loading branch information
rlho authored Apr 16, 2024
2 parents 019d5ad + 12c2e21 commit 06abc0c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ <h2>Room Reservation Request</h2>
<?= roomId ?>
</p>

<p>
First name:
<?= firstName ?>
</p>
<p>
Last name:
<?= lastName ?>
</p>

<p>
Email:
<?= email ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
<?= roomId ?>
</p>

<p>
First name:
<?= firstName ?>
</p>
<p>
Last name:
<?= lastName ?>
</p>
<p>
Email:
<?= email ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,13 @@ export default function useSubmitBooking(): [
formatDate(new Date()),
]);

const isAutoApproval = (selectedRoomIds: string[], data: Booking) => {
const startDate = new Date(data.startDate);
const endDate = new Date(data.endDate);
const isAutoApproval = (
selectedRoomIds: string[],
data: Booking,
bookingCalendarInfo
) => {
const startDate = new Date(bookingCalendarInfo?.startStr);
const endDate = new Date(bookingCalendarInfo?.endStr);
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 (
Expand All @@ -141,7 +145,7 @@ export default function useSubmitBooking(): [
);
};

if (isAutoApproval(selectedRoomIds, data)) {
if (isAutoApproval(selectedRoomIds, data, bookingCalendarInfo)) {
serverFunctions.approveInstantBooking(calendarEventId);
} else {
const getApprovalUrl = serverFunctions.approvalUrl(calendarEventId);
Expand Down

0 comments on commit 06abc0c

Please sign in to comment.