File tree Expand file tree Collapse file tree
src/main/java/com/example/FixLog Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -201,17 +201,15 @@ public String togglePostLike(Long postIdInput){
201201 // 게시글 북마크
202202 public String toggleBookmark (Long postIdInput ){
203203 Member member = memberService .getCurrentMemberInfo ();
204-
205204 Post postId = postRepository .findById (postIdInput )
206205 .orElseThrow (() -> new CustomException (ErrorCode .POST_NOT_FOUND ));
207206
208207 BookmarkFolder folderId = bookmarkFolderRepository .findByUserId (member ); // 이 코드는 폴더가 하나일 때만 적용됨
209208 Optional <Bookmark > optionalBookmark = bookmarkRepository .findByFolderIdAndPostId (folderId , postId );
210209
211210 // 본인 글은 북마크 못하도록
212- if (member == folderId .getUserId ())
211+ if (member == postId .getUserId ())
213212 throw new CustomException (ErrorCode .SELF_BOOKMARK_NOT_ALLOWED );
214-
215213 // 북마크 처리
216214 if (optionalBookmark .isEmpty ()){ // 객체 없는 경우
217215 Bookmark newBookmark = new Bookmark (folderId , postId );
You can’t perform that action at this time.
0 commit comments