From 2db6511a19a98f09e7c1e208ef2209994f31c047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A0=95=EB=AF=BC?= Date: Fri, 2 Aug 2024 13:20:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20qna=20delete=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/edufocus/edufocus/qna/service/QnaServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java index 5ab58f9..c9e537f 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/service/QnaServiceImpl.java @@ -138,6 +138,9 @@ qnaRepository.deleteById(id); @Override public void deleteAnswer(Long id) throws SQLException { - qnaRepository.deleteById(id); + Qna findQna = qnaRepository.findById(id).orElse(null); + findQna.setAnswer(null); + qnaRepository.save(findQna); + } }