From 8a6d6eebdf2df9f6ac3ae287a8eb47a1eabedc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=EC=9C=A0=EB=A6=AC?= <99jiyusu@gmail.com> Date: Sun, 26 Mar 2023 22:21:55 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EA=B3=B5=EB=AA=A8=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20API=20=ED=97=A4=EB=8D=94=EC=97=90=20token=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/cahoots/create.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/cahoots/create.tsx b/src/pages/cahoots/create.tsx index 3fd8bdb..2c98ead 100644 --- a/src/pages/cahoots/create.tsx +++ b/src/pages/cahoots/create.tsx @@ -16,6 +16,7 @@ import HeaderWithBackButton from '@/components/mypage/HeaderWithBackButton'; import PlaceSearchBar from '@/components/PlaceSearchBar'; import { useSuspendedQuery } from '@/hooks/useSuspendedQuery'; import wrapper from '@/store'; +import { useTypeSelector } from '@/store'; import { CountriesType } from '@/types/cahoot'; import { Response } from '@/types/response'; // import Map from '@/components/Map'; @@ -51,6 +52,7 @@ export interface FormDataType { } export default function CreateCahoot() { + const token = useTypeSelector((state) => state.user.token); const router = useRouter(); const selectBoxContainer = useRef(null); const [selectedCountry, setSelectedCountry] = useState('국가'); // 휴양지 위치 @@ -75,6 +77,7 @@ export default function CreateCahoot() { fetch(`${process.env.NEXT_PUBLIC_HOST}/api/auth/cahoots`, { method: 'POST', + headers: { Authorization: `Bearer ${token}` }, body: formData, }) .then((response) => response.json())