From f321347a7da1357844e020940ee334049e336b2d Mon Sep 17 00:00:00 2001 From: Gwanho Kim Date: Sun, 11 Feb 2024 16:21:26 +0900 Subject: [PATCH] Restore original statement And change variable name --- src/popo/reservation/equip/reserve.equip.controller.ts | 4 ++-- src/popo/reservation/place/reserve.place.controller.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/popo/reservation/equip/reserve.equip.controller.ts b/src/popo/reservation/equip/reserve.equip.controller.ts index 57d9963..df0d696 100644 --- a/src/popo/reservation/equip/reserve.equip.controller.ts +++ b/src/popo/reservation/equip/reserve.equip.controller.ts @@ -172,10 +172,10 @@ export class ReserveEquipController { } else { if (reservation.booker_id == user.uuid) { // if the reservation is in the past, deny delete - const reservation_time = reservation.date + reservation.start_time; + const reservation_start_time = reservation.date + reservation.start_time; const current_time = moment().tz('Asia/Seoul').format('YYYYMMDDHHmm'); - if (reservation_time < current_time) { + if (reservation_start_time < current_time) { throw new BadRequestException('Cannot delete past reservation'); } else { await this.reserveEquipService.remove(uuid); diff --git a/src/popo/reservation/place/reserve.place.controller.ts b/src/popo/reservation/place/reserve.place.controller.ts index 4b59343..c35f84b 100644 --- a/src/popo/reservation/place/reserve.place.controller.ts +++ b/src/popo/reservation/place/reserve.place.controller.ts @@ -283,7 +283,7 @@ export class ReservePlaceController { const reservation = await this.reservePlaceService.findOneByUuidOrFail(uuid); const user = req.user; - if (false) { + if (user.userType == UserType.admin || user.userType == UserType.staff) { await this.reservePlaceService.remove(uuid); } else { if (reservation.booker_id == user.uuid) {