-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block delete reservation after its start time #94
Conversation
If start time of equipment or place passed current time, then block delete function
considering date, start_time when compare reservation time with current time
if(reservation.start_time < new Date().toISOString()) { | ||
throw new BadRequestException('Cannot delete past reservation'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요렇게 바꿔보시죵
const reservation_start_time = reservation.date + reservation.start_time;
const current_time = moment().format('YYYYMMDDHHmm')
if(reservation_start_time < current_time) {
throw new BadRequestException('Cannot delete past reservation');
}
그 아래 place reservation도 마찬가지!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런게 있었네요.. 해보겠습니다
And change variable name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#90 If start time of equipment or place passed current time, then block delete function