Skip to content

2023 03 30 개발 일지

Jinho Kim edited this page Mar 29, 2023 · 14 revisions

1. 진행 및 완료 사항

createUser(회원가입) 메서드에서 중복된 아이디일 경우 에러 처리

2. 알게 된 점

createUser(회원가입) 메서드

  • repository에 createQueryBuilder가 들어있어서 아래와 같은 방식으로 쉽게 확인할 수 있었다.
    const userId = createUserDto.userId;
    const existUser = await this.userRepository
      .createQueryBuilder('user')
      .where('user.userId = :userId', { userId })
      .select(['user.userId'])
      .getOne();
    console.log(existUser);
    if (existUser) {
      throw new HttpException('User id already exists', HttpStatus.BAD_REQUEST);
    }

3. TODO

로그인 API 구현

Clone this wiki locally