Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces state management for promises, transitioning their status between 'PENDING' and 'PROCEEDING' as candidates are added or removed. It also enables default CORS settings in the security configuration. Feedback was provided to ensure that the promise status only considers active candidates when determining if it should revert to 'PENDING', preventing incorrect state transitions when inactive candidates exist.
|
|
||
| Optional<Candidate> findByIdAndPromiseId(Long candidateId, Long promiseId); | ||
|
|
||
| long countByPromiseId(Long promiseId); |
There was a problem hiding this comment.
Comment on lines
+113
to
+114
| // 마지막 후보지 삭제 시 약속 상태를 다시 장소 미정으로 되돌림 | ||
| if (candidateRepository.countByPromiseId(promiseId) == 0) { |
There was a problem hiding this comment.
비활성화된 후보지가 존재하더라도 활성화된 후보지가 모두 삭제되었다면 약속 상태를 '장소 미정(PENDING)'으로 되돌려야 합니다. 앞서 CandidateRepository에 제안한 countByPromiseIdAndIsActiveTrue 메서드를 사용하여 활성 후보지 존재 여부를 체크하도록 수정하는 것이 좋습니다.
Suggested change
| // 마지막 후보지 삭제 시 약속 상태를 다시 장소 미정으로 되돌림 | |
| if (candidateRepository.countByPromiseId(promiseId) == 0) { | |
| // 마지막 활성 후보지 삭제 시 약속 상태를 다시 장소 미정으로 되돌림 | |
| if (candidateRepository.countByPromiseIdAndIsActiveTrue(promiseId) == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 관련 이슈
✅ 작업 분류
✨ 작업 내용
.cors(Customizer.withDefaults())추가👥 전달사항
✅ 체크리스트
📸 스크린샷
💡 배운 것 / 시도한 것 / 고민한 점
문제 상황
원인
WebMvcConfigurer.addCorsMappings는 MVCHandlerMapping의 interceptor해결 방안
SecurityConfig의SecurityFilterChain에http.cors(Customizer.withDefaults())한 줄 추가동작 흐름
CorsFilter실행CorsFilter가 사용할CorsConfigurationSource빈 탐색 → 없음HandlerMappingIntrospector를 통해 MVC의addCorsMappings설정을 읽어옴→ 실패해도 헤더는 이미 붙어있는 상태로 응답
→ 401/403 응답에도 CORS 헤더 정상 포함
보안 영향
localhost:5173,netlify,vercel) 변경 없음 → 허용된 곳만 허용, 차단된 곳은 그대로 차단