Skip to content

Commit

Permalink
Merge pull request #33 from flowerseok/feature/socialshare
Browse files Browse the repository at this point in the history
[hotfix] 결과페이지 로직구현 오류해결
  • Loading branch information
oooppq authored Feb 1, 2024
2 parents 48d049f + 53aa2e6 commit 755364b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
18 changes: 12 additions & 6 deletions app/find-taste/result/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@ const Page = ({ searchParams }: ResultPageProps) => {
style2: searchParams.vibe ? searchParams.vibe[1] : '',
};
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,
};
const datafetch = async () => {
try {
const res = await fetch('/api/extract', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ payload }),
});

Expand Down
2 changes: 0 additions & 2 deletions app/find-taste/test/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const Page = () => {
setSelections((prev) => ({ ...prev, [category]: selection }));
};

// handleSumbit 수정

const handleSubmit = () => {
Object.entries(selections).forEach(([key, value]) => {
if (Array.isArray(value)) {
Expand Down
3 changes: 1 addition & 2 deletions components/matchingtest/ResultModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});
Expand Down

0 comments on commit 755364b

Please sign in to comment.