From fffa2546c2497eed47b659aceeb70edafc140441 Mon Sep 17 00:00:00 2001 From: hyeiis Date: Mon, 4 Dec 2023 13:58:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Fix]=20#56=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/detail/edit/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/detail/edit/page.tsx b/src/app/detail/edit/page.tsx index 77e74a4..a9671da 100644 --- a/src/app/detail/edit/page.tsx +++ b/src/app/detail/edit/page.tsx @@ -146,7 +146,9 @@ export default function EditDetail(): JSX.Element { await Promise.all( initialImages.map((image) => { const filename = image.imageUrl.split("/").pop() || "image"; - return urlToFile(image.imageUrl, filename); + const filenameWithoutPath = + filename.split("_weatherift_").pop() || filename; // 이미지 파일명 추출 + return urlToFile(image.imageUrl, filenameWithoutPath); }), ) ).filter(Boolean); @@ -168,6 +170,8 @@ export default function EditDetail(): JSX.Element { deletedImages: deleteImageIds, }; + // imageUrl 보낼 때 앞에 https://~~ 다 지우고 test1.jpeg만 보내는 형식으로 + formData.append("board", JSON.stringify(boardData)); allImages.forEach((image) => { formData.append("images", image); From b3f51bf7bfdff9f049f86e1f8c6e20e82b67800c Mon Sep 17 00:00:00 2001 From: hyeiis Date: Mon, 4 Dec 2023 20:13:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Fix]=20#56=20=EA=B2=8C=EC=8B=9C=EA=B8=80?= =?UTF-8?q?=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/detail/edit/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/detail/edit/page.tsx b/src/app/detail/edit/page.tsx index a9671da..172cb8e 100644 --- a/src/app/detail/edit/page.tsx +++ b/src/app/detail/edit/page.tsx @@ -46,6 +46,7 @@ async function urlToFile(url: any, filename: any) { throw new Error(errorObj.error); } const blob = await res.blob(); + // const extension = filename.split(".").pop(); const extension = filename.split(".").pop(); let mimeType = ""; @@ -147,7 +148,7 @@ export default function EditDetail(): JSX.Element { initialImages.map((image) => { const filename = image.imageUrl.split("/").pop() || "image"; const filenameWithoutPath = - filename.split("_weatherift_").pop() || filename; // 이미지 파일명 추출 + filename.split("_weatherfit_").pop() || filename; // 이미지 파일명 추출 return urlToFile(image.imageUrl, filenameWithoutPath); }), )