From 57329b50a2f6517ee655612476d1e2f2b5fb4880 Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 14:25:50 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20=ED=8F=AC=ED=8A=B8=ED=8F=B4=EB=A6=AC?= =?UTF-8?q?=EC=98=A4=20=EC=88=98=EC=A0=95=20=EB=A1=9C=EC=A7=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 18 +++++++++++++++--- utils/file.ts | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index 6d8f624c..f2d11d2b 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -56,7 +56,7 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { if (editVideoFile) return getFileUidByFileUpload(editVideoFile, openToast); if (videoFileUid && !editVideoFile) return videoFileUid; - return undefined; + return "299ae74e-dbda-4def-a3b0-0939aadd997c.mp4"; }; const getThumbnailFileUid = () => { @@ -72,8 +72,20 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { portfolioType: getPortfolioType(), skillList: selectedSkills, contributorIdList: selectedMembers.map((member) => member.memberId), - videoFileUid: await getVideoFileUid(), - thumbnailFileUid: await getThumbnailFileUid(), + videoFileUid: (await getVideoFileUid()) || undefined, + thumbnailFileUid: (await getThumbnailFileUid()) || "ㅇㅇㅇ", + video: undefined, + thumbnail: undefined, + writer: undefined, + scope: undefined, + contributorList: undefined, + bookmarks: undefined, + bookmarkYn: undefined, + followYn: undefined, + views: undefined, + comments: undefined, + recommendStatus: undefined, + createdDate: undefined, }) .then(() => { openToast("수정이 완료되었습니다."); diff --git a/utils/file.ts b/utils/file.ts index 38d194e4..5b6edd14 100644 --- a/utils/file.ts +++ b/utils/file.ts @@ -19,9 +19,9 @@ export const getFileUidByFileUpload = async ( ) => { return httpClient.file .upload(getFormData(file)) - .then(({ data }) => { + .then((r) => { openToast("파일 업로드에 성공하였습니다."); - return data.fileUid; + return r.data.fileUid; }) .catch(() => openToast("파일 업로드에 실패하였습니다.", { type: "danger" }), From f1b5adc950af5adcdcdee427ce2581a57be04322 Mon Sep 17 00:00:00 2001 From: J1min Date: Thu, 16 Mar 2023 14:37:12 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20=EC=88=98=EC=A0=95=EC=8B=9C=20portfo?= =?UTF-8?q?lioType=20=20=EC=A0=95=EC=9D=98=ED=95=98=EB=8A=94=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/portfolio/edit/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index f2d11d2b..6ccdda8c 100644 --- a/components/portfolio/edit/index.tsx +++ b/components/portfolio/edit/index.tsx @@ -43,7 +43,7 @@ export default function PortfolioEdit({ portfolioId }: PortfolioEditProps) { const onValid: SubmitHandler = async (data) => { const getPortfolioType = (): PortfolioType => { - if (data.portfolioUrl.length > 0 && videoFileUid) { + if (data.portfolioUrl.length > 0 && (videoFileUid || editVideoFile)) { return "ALL"; } if (videoFileUid) {