Skip to content

Commit

Permalink
Merge pull request #54 from kookmin-sw/feat/debug2
Browse files Browse the repository at this point in the history
feat: 자기소개서 디버깅 완료, validation 수정
  • Loading branch information
KimChanJin97 authored May 8, 2024
2 parents a5c06a1 + 24ee7c4 commit 2431a9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public ResumePostPutResponse postMyResume(
) throws IOException {

validateCategories(request.categories());
validateContent(request.content());
Member member = validateMemberHasResume(memberId);

List<String> resumeImagesS3url = bucketService.uploadResumeImages(request.images());
Expand Down Expand Up @@ -118,7 +117,6 @@ public ResumePostPutResponse putMyResume(
) throws IOException {

validateCategories(request.categories());
validateContent(request.content());

Member me = findMemberById(memberId);
Resume mine = findResumeByMember(me); // 영속 상태
Expand Down Expand Up @@ -174,14 +172,8 @@ private Resume findResumeByMember(Member member) {
.orElseThrow(() -> new ResumeException(NO_RESUME));
}

private void validateContent(String content) {
if (content.trim().length() == 0 || content == null || content.isEmpty()) {
throw new ResumeException(MUST_FILL_CONTENT);
}
}

private void validateCategories(List<String> categories) {
if (categories.size() == 0 || categories == null || categories.isEmpty()) {
if (categories == null || categories.size() == 0 || categories.isEmpty()) { // null validation 먼저
throw new ResumeException(MUST_SELECT_ONE_CATEGORY);
}
}
Expand Down

0 comments on commit 2431a9e

Please sign in to comment.