From 618180bf26246a1851a336f30f8e8f2d729decbc Mon Sep 17 00:00:00 2001 From: HyunJinNo Date: Tue, 17 Sep 2024 22:55:39 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=97=AC=ED=96=89=EC=9D=BC=EA=B8=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=8B=9C=20=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=EA=B0=80=20=EC=95=88=20=EB=B3=B4=EC=9D=B4=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/diary/[id]/route.ts | 1 + src/containers/diary/edit/DiaryEditorContainer.tsx | 7 +++++-- src/containers/diary/write/DiaryEditorContainer.tsx | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/api/diary/[id]/route.ts b/src/app/api/diary/[id]/route.ts index cb2c7623..e16bccc4 100644 --- a/src/app/api/diary/[id]/route.ts +++ b/src/app/api/diary/[id]/route.ts @@ -54,5 +54,6 @@ export async function DELETE( ); revalidateTag("getDiaryList"); + revalidateTag(`getDiary/${params.id}`); return response; } diff --git a/src/containers/diary/edit/DiaryEditorContainer.tsx b/src/containers/diary/edit/DiaryEditorContainer.tsx index 2e4a41e9..6d64c90a 100644 --- a/src/containers/diary/edit/DiaryEditorContainer.tsx +++ b/src/containers/diary/edit/DiaryEditorContainer.tsx @@ -71,7 +71,7 @@ const DiaryEditorContainer = ({ diaryData }: Props) => { .join(","); if (imageUrl === "") { - alert("Day1에 최소 1장의 이미지를 등록해 주세요."); + alert("최소 1장의 이미지를 등록해 주세요."); return; } @@ -102,7 +102,10 @@ const DiaryEditorContainer = ({ diaryData }: Props) => { content: sanitizeHtml(contents, sanitizeOption), feelingStatus: FEELING_STATUS[moodLevels], deleteImagesUrl: originalContentUrl - .filter((value) => !contentImagesUrl.split(",").includes(value)) + .filter( + (value) => + !contentImagesUrl.split(",").includes(value) && value !== image, + ) .join(","), saveImagesUrl: contentImagesUrl, place: address, diff --git a/src/containers/diary/write/DiaryEditorContainer.tsx b/src/containers/diary/write/DiaryEditorContainer.tsx index 690f4ab9..73fbd003 100644 --- a/src/containers/diary/write/DiaryEditorContainer.tsx +++ b/src/containers/diary/write/DiaryEditorContainer.tsx @@ -65,7 +65,7 @@ const DiaryEditorContainer = () => { .join(","); if (imageUrl === "") { - alert("Day1에 최소 1장의 이미지를 등록해 주세요."); + alert("최소 1장의 이미지를 등록해 주세요."); return; }