From 9be1e858e09e826890f7823fb664cf077f8abffa Mon Sep 17 00:00:00 2001 From: Minkyu0424 Date: Tue, 28 May 2024 14:10:05 +0900 Subject: [PATCH 1/2] =?UTF-8?q?:ambulance:[hotfix]:=20=ED=94=84=EC=82=AC?= =?UTF-8?q?=20=EC=82=AC=EC=9A=A9=EC=9E=90=20=EC=9D=B4=EB=A6=84=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(route)/mypage/myCovletDetail/[id]/page.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx b/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx index 7f3bdb2..909bcac 100644 --- a/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx +++ b/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx @@ -120,8 +120,10 @@ const MyCovletDetailPage = ({ params }: { params: { id: string } }) => {
Date: Tue, 28 May 2024 14:16:46 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20[fix]:=20pull=20=EC=A0=84=20?= =?UTF-8?q?commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mypage/myCovletDetail/[id]/page.tsx | 12 +++++--- src/app/components/coverletter/CovletMain.tsx | 29 ++++++++++++++++++- .../experience/ExpInfoContainer.tsx | 4 +-- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx b/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx index 7b64aeb..4b7659b 100644 --- a/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx +++ b/src/app/(route)/mypage/myCovletDetail/[id]/page.tsx @@ -114,15 +114,19 @@ const MyCovletDetailPage = ({ params }: { params: { id: string } }) => { } }, [params.id]) + const isGuestValue = isGuest !== 'undefined' && isGuest !== null ? isGuest : '' + const writerNameValue = writerName !== 'undefined' && writerName !== null ? writerName : userInfo?.memberName + const profileValue = profile !== 'undefined' && profile !== null ? profile : userInfo?.profile + return (
{ } goToNextPage() } + const updateCovData = async () => { + const { ...dataToSend } = coverletterData + + const urlPath = isEdit + ? `/api/coverletters/save?id=${id}` + : `/api/coverletters` + const methodType = isEdit ? 'PATCH' : 'POST' + const response = await fetch(urlPath, { + method: methodType, + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + ...dataToSend, + }), + }) + const resData = await response.json() + setCoverLetterData({ + ...coverletterData, + coverLetterId: resData.result.coverLetterId, + }) + + if (!response.ok) { + console.error('데이터 저장에 실패했습니다.') + } + router.push('/mypage') + } return (
@@ -340,7 +367,7 @@ const CovletMain = ({ isEdit, id }: CovletFinishContainerProps) => {