Skip to content

Commit 72ad2f2

Browse files
committed
!HOTFIX: 지원서 목록 인터뷰 없는 경우 null 전달
1 parent c3ade91 commit 72ad2f2

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/main/java/land/leets/domain/application/presentation/ApplicationController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Application create(@AuthenticationPrincipal AuthDetails authDetails, @Req
5252
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
5353
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
5454
})
55-
@PatchMapping()
55+
@PatchMapping
5656
public Application update(@AuthenticationPrincipal AuthDetails authDetails, @RequestBody ApplicationRequest request) {
5757
return updateApplication.execute(authDetails, request);
5858
}
@@ -65,7 +65,7 @@ public Application update(@AuthenticationPrincipal AuthDetails authDetails, @Req
6565
@ApiResponse(responseCode = "404", content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
6666
@ApiResponse(responseCode = "500", content = @Content(schema = @Schema(implementation = ErrorResponse.class)))
6767
})
68-
@GetMapping()
68+
@GetMapping
6969
public List<ApplicationResponse> get(@RequestParam(required = false) String position,
7070
@RequestParam(required = false) String status) {
7171
if (position == null && status == null) return getApplication.execute();

src/main/java/land/leets/domain/interview/presentation/dto/res/InterviewResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import land.leets.domain.interview.type.HasInterview;
44
import lombok.AllArgsConstructor;
5+
import lombok.Builder;
56
import lombok.Getter;
67

78
import java.time.LocalDateTime;
89

910
@Getter
11+
@Builder
1012
@AllArgsConstructor
1113
public class InterviewResponse {
1214
private HasInterview hasInterview;

src/main/java/land/leets/domain/interview/usecase/GetInterviewImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
import land.leets.domain.application.domain.Application;
44
import land.leets.domain.interview.domain.Interview;
55
import land.leets.domain.interview.domain.repository.InterviewRepository;
6-
import land.leets.domain.interview.exception.InterviewNotFoundException;
76
import land.leets.domain.interview.presentation.dto.res.InterviewResponse;
87
import land.leets.domain.interview.presentation.mapper.InterviewMapper;
98
import lombok.RequiredArgsConstructor;
109
import org.springframework.stereotype.Service;
1110

11+
import java.util.Optional;
12+
1213
@Service
1314
@RequiredArgsConstructor
1415
public class GetInterviewImpl implements GetInterview {
@@ -17,7 +18,10 @@ public class GetInterviewImpl implements GetInterview {
1718

1819
@Override
1920
public InterviewResponse execute(Application application) {
20-
Interview interview = interviewRepository.findByApplication(application).orElseThrow(InterviewNotFoundException::new);
21-
return interviewMapper.mappingToDto(interview);
21+
Optional<Interview> interview = interviewRepository.findByApplication(application);
22+
if (interview.isPresent()) {
23+
return interviewMapper.mappingToDto(interview.get());
24+
}
25+
return InterviewResponse.builder().build();
2226
}
2327
}

0 commit comments

Comments
 (0)