Skip to content

Commit

Permalink
fix: 리크루트 오류 수정
Browse files Browse the repository at this point in the history
fix: 리크루트 목록조회 category null 처리
fix: 리크루트 등록 시  question 빈값 처리
  • Loading branch information
khs960616 committed Oct 14, 2023
1 parent 12488b8 commit 2d77c60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.util.List;
import java.util.stream.Collectors;

import org.springframework.util.StringUtils;

@Getter
@NoArgsConstructor
@AllArgsConstructor
Expand Down Expand Up @@ -68,7 +70,9 @@ public Recruit to() {
private void setRecruitQuestions (Recruit recruit) {
if(questions == null) return;

List<RecruitQuestion> recruitQuestions = questions.stream().map((question)-> RecruitQuestion.builder()
List<RecruitQuestion> recruitQuestions = questions.stream()
.filter(StringUtils::hasText)
.map((question)-> RecruitQuestion.builder()
.recruit(recruit)
.content(question)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Slice<Recruit> findRecruitByGetRecruitsReqDto(GetRecruitsReqDto dto, Page

// recruit types limitation
List<String> recruitTypes = dto.getRecruitTypes();
if(dto.getCategory().toUpperCase().equals(Category.PROJECT.name()) && recruitTypes!=null && !recruitTypes.isEmpty()) {
if(dto.getCategory() != null && dto.getCategory().toUpperCase().equals(Category.PROJECT.name()) && recruitTypes!=null && !recruitTypes.isEmpty()) {
String metaDataType = MetaDataType.RECRUIT_TYPE.name();
List<MetaData> containRecruitTypes = recruitTypes.stream()
.map(recruitType->metaDataConsumer.getMetaData(metaDataType, recruitType))
Expand Down

0 comments on commit 2d77c60

Please sign in to comment.