Skip to content

Commit

Permalink
fix: 닉네임 중복시http code 202 (#386)
Browse files Browse the repository at this point in the history
Co-authored-by: jeong-yong-shin <[email protected]>
  • Loading branch information
sjy982 and jeong-yong-shin authored Dec 11, 2023
1 parent ad28f28 commit aaf3ea7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions BackEnd/src/auth/exceptions/auth.exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@ export class NotFirstLoginException extends HttpException {
super(response, HttpStatus.OK);
}
}

export class NicknameDuplicate202Exception extends HttpException {
constructor() {
const response = {
statusCode: null,
message: null,
};
const httpCode = 202;
super(response, httpCode);
}
}
4 changes: 2 additions & 2 deletions BackEnd/src/profiles/profiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { UpdateProfileDto } from './dto/update-profile.dto';
import { Post } from '../posts/entities/posts.entity';
import { PaginateProfilePostDto } from './dto/paginate-profile-post.dto';
import { CommonService } from '../common/common.service';
import { NicknameDuplicateException } from '../auth/exceptions/auth.exception';
import { NicknameDuplicate202Exception } from '../auth/exceptions/auth.exception';
import { getProfilePostsQueryOptions } from './queryOptions/get-profilePosts-queryOptions';

@Injectable()
Expand Down Expand Up @@ -36,7 +36,7 @@ export class ProfilesService {
},
});
if(result) {
throw new NicknameDuplicateException();
throw new NicknameDuplicate202Exception();
}
return null;
}
Expand Down

0 comments on commit aaf3ea7

Please sign in to comment.