Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Pet 정보 수정 시 오류 수정 #95

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Fix: Pet 정보 수정 시 오류 수정 #95

merged 1 commit into from
Jan 20, 2025

Conversation

seoyeonjin
Copy link
Collaborator

🔥Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

  • pet 수정 시 오류있어서 수정했습니다.
  • breed 수정 요청 있을 때만 변경하도록 수정
  • 증상 리스트 유효한지 판단하는 코드 수정
  • 질병 리스트 유효한지 판단하는 코드 수정

🚨 참고 사항

@seoyeonjin seoyeonjin self-assigned this Jan 20, 2025
List<Long> validDiseaseIds = petDiseaseRepository.findAllById(diseaseIds).stream()
.map(PetDisease::getId)
List<Long> validDiseaseIds = diseaseRepository.findByIdIn(diseaseIds).stream()
.map(Disease::getId)
.toList();

List<Long> invalidDiseaseIds = diseaseIds.stream()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2;

이 로직 stream으로 한번에 검증하면 좋을 거 같습니다!

@@ -93,8 +93,8 @@ private void validatePetDiseases(List<Long> diseaseIds) {
}

private void validatePetSymptoms(List<Long> symptomIds) {
List<Long> validSymptomIds = petSymptomRepository.findAllById(symptomIds).stream()
.map(PetSymptom::getId)
List<Long> validSymptomIds = symptomRepository.findByIdIn(symptomIds).stream()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2;

여기도요!

@seoyeonjin seoyeonjin merged commit 46b4d1f into dev Jan 20, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants