diff --git a/serverless/dongbti/handler.js b/serverless/dongbti/handler.js index 27c4e76..71167fa 100644 --- a/serverless/dongbti/handler.js +++ b/serverless/dongbti/handler.js @@ -47,7 +47,7 @@ const resultTypes = [ "matSportsman", "fightSportsman", "uniqueSportsman", - "10cm", + "tencm", "tchaikovsky", "stageMusician", "mozart", diff --git a/src/hooks/useSubmitResult.tsx b/src/hooks/useSubmitResult.tsx index e2820fc..387d68f 100644 --- a/src/hooks/useSubmitResult.tsx +++ b/src/hooks/useSubmitResult.tsx @@ -1,11 +1,10 @@ -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { useNavigate, useSearchParams } from "react-router-dom"; import { api } from "@/config/axios"; import { useUserInfo } from "@/store/store"; export const useSubmitResult = () => { - const [isPending, setIsPending] = useState(false); const department = useUserInfo((state) => state.department); const navigate = useNavigate(); @@ -15,14 +14,10 @@ export const useSubmitResult = () => { const mbti = searchParams.get("type"); console.log(searchParams); - api.post("/stats", { department: department, mbti }) - .then(() => { - navigate(`/result?type=${mbti}`); - }) - .finally(() => { - setIsPending(false); - }); + api.post("/stats", { department, mbti }).finally(() => { + navigate(`/result?type=${mbti}`); + }); }, []); - return { isPending }; + return null; };