Skip to content

Commit 7a20bf7

Browse files
committed
hotfix: 답변 페이지 오류 수정
1 parent 21809d7 commit 7a20bf7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/app/answer/page.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import React from 'react'
44
import client from '@/utils/client'
5-
import { useRouter } from 'next/navigation'
5+
import { useSearchParams } from "next/navigation";
66
import styles from "./answer.module.css";
77

88

@@ -16,8 +16,7 @@ const LoadingSpinner = () => {
1616

1717

1818
const Answer = () => {
19-
const router = useRouter()
20-
const query = router.query
19+
const token = useSearchParams().get('token')
2120
const [choice, setChoice] = React.useState(null)
2221
const [loading, setLoading] = React.useState(false)
2322

@@ -30,7 +29,7 @@ const Answer = () => {
3029
try {
3130
setLoading(true)
3231
const test = await client().post(`/api/responses`, {
33-
token: query.token,
32+
token: token,
3433
choice
3534
})
3635
if (test.message)

0 commit comments

Comments
 (0)