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; }