Skip to content

Commit

Permalink
fix: 같은 이름으로 두 번 예약 못하면 안되므로
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaemy committed Aug 9, 2023
1 parent ff3ff35 commit 0a63894
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/api/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,12 @@ export class UsersService {
const { roomCode, username, password, dates, dateOnly } =
createAppointmentDto;

if (await this.findOne(username)) {
badRequestErros.push('Username already exists');
}

const uniqueDates = new Set(dates);
if (dates.length !== uniqueDates.size) {
badRequestErros.push('dates must be unique');
}
/*
dates는 ['2023-07-19 12:30','2023-07-20 13:45']이런 식으로 된 배열이며
dates는 ['2023-07-19 12:30','2023-07-20 13:45']이런 식으로 된 배열이며
공백을 기준으로 날짜와 시간으로 나눕니다.
*/
if (!(await this.isDateOnlyFormatValid(dateOnly, dates))) {
Expand Down

0 comments on commit 0a63894

Please sign in to comment.