Skip to content

Commit

Permalink
Fix: 여행일기 수정 시 이미지가 안 보이는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
HyunJinNo committed Sep 17, 2024
1 parent c3defc7 commit 618180b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/api/diary/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ export async function DELETE(
);

revalidateTag("getDiaryList");
revalidateTag(`getDiary/${params.id}`);
return response;
}
7 changes: 5 additions & 2 deletions src/containers/diary/edit/DiaryEditorContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DiaryEditorContainer = ({ diaryData }: Props) => {
.join(",");

if (imageUrl === "") {
alert("Day1에 최소 1장의 이미지를 등록해 주세요.");
alert("최소 1장의 이미지를 등록해 주세요.");
return;
}

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/containers/diary/write/DiaryEditorContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const DiaryEditorContainer = () => {
.join(",");

if (imageUrl === "") {
alert("Day1에 최소 1장의 이미지를 등록해 주세요.");
alert("최소 1장의 이미지를 등록해 주세요.");
return;
}

Expand Down

0 comments on commit 618180b

Please sign in to comment.