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]액션 플랜 완료 API로직 수정 #50

Merged
merged 7 commits into from
Jan 4, 2024

Conversation

Hong0329
Copy link
Contributor

📣 Related Issue

📝 Summary

  • 액션 플랜 완료했을 때 멤버의 쑥 개수가 추가되도록 로직 수정했습니다.
  • 만약 이미 완료된 액션 플랜이라면 오류 발생하도록 했습니다.
스크린샷 2023-12-28 오전 2 54 19

🙏 Question & PR point

📬 Reference

Copy link
Member

@yeseul106 yeseul106 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 ~~~

Comment on lines 38 to 46
List<String> contents = actionPlanCreateRequestDto.getContents();

for(String content : contents) {
ActionPlan actionPlan = ActionPlan.builder()
.content(content)
.seed(seed)
.build();
actionPlanRepository.save(actionPlan);
}
Copy link
Member

@yeseul106 yeseul106 Dec 28, 2023

Choose a reason for hiding this comment

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

�stream 문법으로 간단하게 나타냈던 것과 통일 시켜서 아래처럼 바꿔도 좋을 것 같아요 ~

Suggested change
List<String> contents = actionPlanCreateRequestDto.getContents();
for(String content : contents) {
ActionPlan actionPlan = ActionPlan.builder()
.content(content)
.seed(seed)
.build();
actionPlanRepository.save(actionPlan);
}
List<String> contents = actionPlanCreateRequestDto.getContents();
contents.stream()
.map(content -> ActionPlan.builder().content(content).seed(seed).build())
.forEach(actionPlanRepository::save);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

와아앙 완전 좋아요!!감쟈합니다👍👍

Copy link
Member

@yeseul106 yeseul106 left a comment

Choose a reason for hiding this comment

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

최고입니다 !!!

@Hong0329 Hong0329 merged commit 19f5ea4 into develop Jan 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FIX]액션 플랜 완료 API로직 수정
2 participants