Skip to content

Commit

Permalink
Merge pull request #314 from TripInfoWeb/dev_diary
Browse files Browse the repository at this point in the history
Fix: 여행일기 수정 시 이미지가 안 보이는 문제 해결
  • Loading branch information
HyunJinNo authored Sep 17, 2024
2 parents 397f605 + 618180b commit 82a34e5
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 82a34e5

Please sign in to comment.