From 6a7cd5da8324cfa2babd5dd2dbc41a5cc01a637f Mon Sep 17 00:00:00 2001 From: Jiseok Date: Thu, 1 Feb 2024 20:27:52 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feature:=20=EA=B2=B0=EA=B3=BC=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=98=A4=EB=A5=98=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/find-taste/result/page.tsx | 26 ++++++++++++++++++++------ app/find-taste/test/page.tsx | 2 -- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/find-taste/result/page.tsx b/app/find-taste/result/page.tsx index 6642a2f..603bd40 100644 --- a/app/find-taste/result/page.tsx +++ b/app/find-taste/result/page.tsx @@ -35,20 +35,34 @@ const Page = ({ searchParams }: ResultPageProps) => { style1: searchParams.vibe ? searchParams.vibe[0] : '', style2: searchParams.vibe ? searchParams.vibe[1] : '', }; + // const payload = { + // concentration: searchParams.persistence, + // season: searchParams.season, + // mainFamily: searchParams.main, + // scent: searchParams.individuality, + // style: searchParams.vibe, + // }; const payload = { - concentration: searchParams.persistence, - season: searchParams.season, - mainFamily: searchParams.main, + concentration: Array.isArray(searchParams.persistence) + ? searchParams.persistence + : [searchParams.persistence], + + season: Array.isArray(searchParams.season) + ? searchParams.season + : [searchParams.season], + + mainFamily: Array.isArray(searchParams.main) + ? searchParams.main + : [searchParams.main], + scent: searchParams.individuality, style: searchParams.vibe, }; + console.log(payload); const datafetch = async () => { try { const res = await fetch('/api/extract', { method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, body: JSON.stringify({ payload }), }); diff --git a/app/find-taste/test/page.tsx b/app/find-taste/test/page.tsx index 512f2c8..384d567 100644 --- a/app/find-taste/test/page.tsx +++ b/app/find-taste/test/page.tsx @@ -40,8 +40,6 @@ const Page = () => { setSelections((prev) => ({ ...prev, [category]: selection })); }; - // handleSumbit 수정 - const handleSubmit = () => { Object.entries(selections).forEach(([key, value]) => { if (Array.isArray(value)) { From 53aa2e65910c12ecbc4a53caad224d55b6bf5993 Mon Sep 17 00:00:00 2001 From: Jiseok Date: Thu, 1 Feb 2024 20:53:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feature=20:=20=EC=B9=B4=EC=B9=B4=EC=98=A4?= =?UTF-8?q?=ED=86=A1=20=EA=B3=B5=EC=9C=A0=ED=95=98=EA=B8=B0=20key=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=EC=84=9C=20=EC=9E=AC=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/find-taste/result/page.tsx | 8 -------- components/matchingtest/ResultModal.tsx | 3 +-- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/find-taste/result/page.tsx b/app/find-taste/result/page.tsx index 603bd40..93ce70e 100644 --- a/app/find-taste/result/page.tsx +++ b/app/find-taste/result/page.tsx @@ -35,13 +35,6 @@ const Page = ({ searchParams }: ResultPageProps) => { style1: searchParams.vibe ? searchParams.vibe[0] : '', style2: searchParams.vibe ? searchParams.vibe[1] : '', }; - // const payload = { - // concentration: searchParams.persistence, - // season: searchParams.season, - // mainFamily: searchParams.main, - // scent: searchParams.individuality, - // style: searchParams.vibe, - // }; const payload = { concentration: Array.isArray(searchParams.persistence) ? searchParams.persistence @@ -58,7 +51,6 @@ const Page = ({ searchParams }: ResultPageProps) => { scent: searchParams.individuality, style: searchParams.vibe, }; - console.log(payload); const datafetch = async () => { try { const res = await fetch('/api/extract', { diff --git a/components/matchingtest/ResultModal.tsx b/components/matchingtest/ResultModal.tsx index de4a856..8925559 100644 --- a/components/matchingtest/ResultModal.tsx +++ b/components/matchingtest/ResultModal.tsx @@ -72,14 +72,13 @@ const ResultModal = ({ onClose }: ResultModalProps) => { if (window.Kakao) { const kakao = window.Kakao; const appKey = process.env.NEXT_PUBLIC_KAKAO_APP_KEY; - const templateId = 103731; + const templateId = 103843; if (!kakao.isInitialized()) { kakao.init(appKey); } kakao.Share.sendCustom({ templateId, templateArgs: { - btnTitle: '테스트하러가기', id: Currentlocation, }, });