feat: allow marking no show after booking has started (#17625)

* feat: allow marking no show after booking has started

* fix

---------

Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
Kartik SainiandUdit Takkar authored and GitHub committed 2024-11-14 09:55:39 +00:00
1 parent 65484e7d01
commit ff2754f663
2 files changed
+12 -1

No files matched your search

+10
View File
@@ -216,6 +216,16 @@ const assertCanAccessBooking = async (bookingUid: string, userId?: number) => {
if (!booking)
throw new HttpError({ statusCode: 403, message: "You are not allowed to access this booking" });
const isUpcoming = new Date(booking.endTime) >= new Date();
const isOngoing = isUpcoming && new Date() >= new Date(booking.startTime);
const isBookingInPast = new Date(booking.endTime) < new Date();
if (!isBookingInPast && !isOngoing) {
throw new HttpError({
statusCode: 403,
message: "Cannot mark no-show before the meeting has started.",
});
}
};
export default handleMarkNoShow;