-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
유저 컨트롤러 코드 질문
23.11.12 16:52 작성 23.11.12 16:53 수정 조회수 86
0
깃허브 코드를 보면
@ApiOperation({ summary: '회원가입' })
@UseGuards(NotLoggedInGuard)
@Post()
async join(@Body() data: JoinRequestDto) {
const user = this.usersService.findByEmail(data.email);
if (!user) {
throw new NotFoundException();
}
const result = await this.usersService.join(
data.email,
data.nickname,
data.password,
);
if (result) {
return 'ok';
} else {
throw new ForbiddenException();
}
}
이런데 여기서 user가 없는데 왜 NotFoundException()을 날리는 건가요? user가 없으면 그대로 join하여 사용자 등록을 해야 하는 것이 아닌가요?
답변을 작성해보세요.
1
답변 1