-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 분실물 게시글 수정 API 추가 #2135
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
feat: 분실물 게시글 수정 API 추가 #2135
Conversation
dh2906
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다
| lostItemArticle.deleteImages(request.deleteImageIds()); | ||
| lostItemArticle.addNewImages(request.newImages()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
삭제 없이 새 이미지를 매 요청마다 최대 10개씩 추가할 수 있어, 동일한 요청을 여러 번 보낼 경우 총 이미지 수가 10개를 초과할 위험이 있어 보여요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 게시글 등록 API에서도 검증 로직이 없어서 뺐습니다.
kih1015
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다
| @Transactional | ||
| public LostItemArticleResponse updateLostItemArticle(Integer userId, Integer articleId, LostItemArticleUpdateRequest request) { | ||
| LostItemArticle lostItemArticle = lostItemArticleRepository.getByArticleId(articleId); | ||
| lostItemArticle.checkOwnership(userId); | ||
|
|
||
| lostItemArticle.update( | ||
| request.category(), | ||
| request.foundPlace(), | ||
| request.foundDate(), | ||
| request.content() | ||
| ); | ||
|
|
||
| lostItemArticle.deleteImages(request.deleteImageIds()); | ||
| lostItemArticle.addNewImages(request.newImages()); | ||
|
|
||
| return LostItemArticleResponse.of(lostItemArticle.getArticle(), true); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔쓰하네요
🔍 개요
🚀 주요 변경 내용
💬 참고 사항
✅ Checklist (완료 조건)