Skip to content

Commit

Permalink
fix: Delete column by postId (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaeeun-Han committed Mar 23, 2024
1 parent 9906857 commit 85e55b8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import com.beotkkot.qtudy.dto.response.posts.*;
import com.beotkkot.qtudy.repository.comments.CommentsRepository;
import com.beotkkot.qtudy.repository.posts.PostsRepository;
import com.beotkkot.qtudy.repository.quiz.QuizRepository;
import com.beotkkot.qtudy.repository.quiz.ReviewRepository;
import com.beotkkot.qtudy.repository.scrap.ScrapRepository;
import com.beotkkot.qtudy.repository.tags.TagsRepository;
import com.beotkkot.qtudy.repository.user.UserRepository;
Expand All @@ -36,6 +38,9 @@ public class PostsService {
private final ScrapRepository scrapRepo;
private final SummaryService summaryService;
private final CommentsRepository commentsRepo;
private final ReviewRepository reviewRepo;
private final QuizRepository quizRepo;


@Transactional
public ResponseEntity<? super PostsResponseDto> savePost(Long kakao_uid, PostsRequestDto dto) {
Expand Down Expand Up @@ -230,6 +235,8 @@ public ResponseEntity<? super PostsResponseDto> deletePost(Long postId, Long kak

scrapRepo.deleteByPostId(postId);
commentsRepo.deleteByPostId(postId);
reviewRepo.deleteByPostId(postId);
quizRepo.deleteByPostId(postId);

// 관련된 hash tag -1
List<String> tagNameList = Arrays.asList(post.getTag().split("\\s*,\\s*"));
Expand Down

0 comments on commit 85e55b8

Please sign in to comment.