From 3edc948ea532295a7d226cec6d70297198c9e07c Mon Sep 17 00:00:00 2001 From: hyuna Date: Sun, 11 Aug 2024 23:15:08 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore=20::=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=97=90=EB=9F=AC=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/bug/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/apis/bug/index.ts b/src/apis/bug/index.ts index cab95d3..2cec80a 100644 --- a/src/apis/bug/index.ts +++ b/src/apis/bug/index.ts @@ -9,7 +9,6 @@ interface BugProp { } export const BugImg = () => { - const { handleError } = ApiError(); return useMutation({ mutationFn: async (param) => { try { @@ -17,10 +16,10 @@ export const BugImg = () => { param.file.forEach((file) => { formData.append("file", file); }); - const result = await instance.post(`/bug/upload`, formData); - return result.data; + const { data } = await instance.post(`/bug/upload`, formData); + return data; } catch (error) { - handleError(error); + alert("이미지 용량이 너무 큽니다"); throw error; } }, From 4f064981267b67852863c3b329cbb68813407028 Mon Sep 17 00:00:00 2001 From: hyuna Date: Mon, 12 Aug 2024 16:58:43 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore=20::=20=EB=B2=84=EA=B7=B8=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/bugReport/page.tsx | 2 -- src/app/components/common/modal/imgModal.tsx | 8 +++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/app/bugReport/page.tsx b/src/app/bugReport/page.tsx index a9744f4..0c337cf 100644 --- a/src/app/bugReport/page.tsx +++ b/src/app/bugReport/page.tsx @@ -19,7 +19,6 @@ interface BugProp { const BugReport = () => { const router = useRouter(); - const [image, setImage] = useState([]); const [data, setData] = useState({ title: "", content: "", @@ -67,7 +66,6 @@ const BugReport = () => { content: "", file_name: [], }); - setImage([]); router.push("/main"); }, onError: () => { diff --git a/src/app/components/common/modal/imgModal.tsx b/src/app/components/common/modal/imgModal.tsx index f56279c..13ab226 100644 --- a/src/app/components/common/modal/imgModal.tsx +++ b/src/app/components/common/modal/imgModal.tsx @@ -108,14 +108,12 @@ const ImgModal: React.FC = ({ isOpen, onClose, onClick }) => {
-
- 이미지를 붙여넣기 해주세요. -
+ placeholder="이미지를 붙여넣기 해주세요" + />
{images.map((image, index) => (
From 927170827b035810a2e349fc2158246d97395f12 Mon Sep 17 00:00:00 2001 From: hyuna Date: Tue, 13 Aug 2024 23:34:53 +0900 Subject: [PATCH 3/4] =?UTF-8?q?add=20::=20=EB=B2=84=EA=B7=B8=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EB=AF=B8=EB=A6=AC=EB=B3=B4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/bugReport/page.tsx | 69 ++++++++++++++------ src/app/components/common/modal/imgModal.tsx | 2 - 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/app/bugReport/page.tsx b/src/app/bugReport/page.tsx index 0c337cf..158d774 100644 --- a/src/app/bugReport/page.tsx +++ b/src/app/bugReport/page.tsx @@ -106,26 +106,55 @@ const BugReport = () => { />
- <> -

버그 사진을 첨부해주세요

- -
{ - setModal(!modal); - }} - /> - + {data.file_name.length === 0 ? ( + <> +

버그 사진을 첨부해주세요

+ +
{ + setModal(!modal); + }} + /> + + ) : ( +
+ {data.file_name.map((item) => ( + + ))} + +
{ + setModal(!modal); + }} + /> +
+ )}
= ({ isOpen, onClose, onClick }) => { const onCancle = () => { onClose(); - setImages([]); }; const AddImg = () => { onClick(images); - setImages([]); onClose(); }; From ef0d3d60604b1737f44f1d539555c89d206f6bac Mon Sep 17 00:00:00 2001 From: hyuna Date: Tue, 13 Aug 2024 23:43:02 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore=20::=20=EB=B9=8C=EB=93=9C=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/bugReport/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/bugReport/page.tsx b/src/app/bugReport/page.tsx index 158d774..bd9cc58 100644 --- a/src/app/bugReport/page.tsx +++ b/src/app/bugReport/page.tsx @@ -129,8 +129,9 @@ const BugReport = () => { ) : (
- {data.file_name.map((item) => ( + {data.file_name.map((item, index) => (