diff --git a/components/portfolio/edit/index.tsx b/components/portfolio/edit/index.tsx index 6d8f624c..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) { @@ -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" }),