From 111ee3bf27c23f228aee23f2b844625bfaed187c Mon Sep 17 00:00:00 2001 From: kimyeonjinn Date: Tue, 24 Sep 2024 18:29:45 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20detailletter=20=EC=B4=88=EC=BD=94=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20status=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/DetailLetter/DetailLetter.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/DetailLetter/DetailLetter.jsx b/src/pages/DetailLetter/DetailLetter.jsx index 96573ff..eb83c80 100644 --- a/src/pages/DetailLetter/DetailLetter.jsx +++ b/src/pages/DetailLetter/DetailLetter.jsx @@ -62,10 +62,9 @@ const DetailLetter = () => { try { const response = await instance.delete(`/api/choco/${id}`); - // 204 응답 - if (!response || response.status === 204) { + if (response && (response.status === 204 || response.status === 200)) { alert("삭제가 완료되었습니다."); - navigate(-1); + navigate(-1); // 이전 페이지로 이동 } else { console.error("Unexpected response structure:", response); alert("삭제에 실패했습니다."); From 5f98abd954a46a5da26a182b1877298082f8b898 Mon Sep 17 00:00:00 2001 From: kimyeonjinn Date: Tue, 24 Sep 2024 19:19:21 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20detailletter=20=EC=B4=88=EC=BD=94=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20status=20=EC=BD=94=EB=93=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/DetailLetter/DetailLetter.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/DetailLetter/DetailLetter.jsx b/src/pages/DetailLetter/DetailLetter.jsx index eb83c80..3bfdd60 100644 --- a/src/pages/DetailLetter/DetailLetter.jsx +++ b/src/pages/DetailLetter/DetailLetter.jsx @@ -62,8 +62,8 @@ const DetailLetter = () => { try { const response = await instance.delete(`/api/choco/${id}`); - if (response && (response.status === 204 || response.status === 200)) { - alert("삭제가 완료되었습니다."); + if (response) { + console.log("삭제가 완료되었습니다."); navigate(-1); // 이전 페이지로 이동 } else { console.error("Unexpected response structure:", response); From 9c2dfee8aaa217082e63202e71438f3a6b52c105 Mon Sep 17 00:00:00 2001 From: kimyeonjinn Date: Tue, 24 Sep 2024 19:40:29 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20otherData=20=EC=BD=98=EC=86=94=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChocoList/ChocoList.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/ChocoList/ChocoList.jsx b/src/pages/ChocoList/ChocoList.jsx index 86016cf..14d473b 100644 --- a/src/pages/ChocoList/ChocoList.jsx +++ b/src/pages/ChocoList/ChocoList.jsx @@ -16,7 +16,7 @@ const ChocoList = () => { const [error, setError] = useState(null); const ITEMS_PER_PAGE = otherData?.boxType === 4 ? 6 : 9; - + console.log("otherData:", otherData); const getChocoList = async (page) => { try { const response = await instance.get(`/api/choco?page=${page}`); @@ -24,6 +24,9 @@ const ChocoList = () => { if (response.data && response.data.message === "SUCCESS") { const { chocoList, totalPage } = response.data.result; + console.log("chocoList:", chocoList); + console.log("totalPage:", totalPage); + setChocoData(chocoList); setTotalPages(totalPage); setError(null);