From cf55e170d65d62c3d6508d0466a347e982d913e7 Mon Sep 17 00:00:00 2001 From: Cllaude99 Date: Sat, 28 Sep 2024 23:39:47 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20post=EC=9A=94=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Modal/PlaceModal.tsx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/components/Modal/PlaceModal.tsx b/src/components/Modal/PlaceModal.tsx index a6a686d..ddf9d84 100644 --- a/src/components/Modal/PlaceModal.tsx +++ b/src/components/Modal/PlaceModal.tsx @@ -46,15 +46,25 @@ export default function PlaceModal({ isOpen, onClose }: ModalProps) { localStorage.removeItem('refreshToken'); localStorage.removeItem('roomId'); if (selectedOption === 'friend') { - const { data } = await axios.post(BACKEND_URL + '/api/rooms', { - roomType: ROOM_TYPE_EACH, - }); + const { data } = await axios.post( + BACKEND_URL + '/api/rooms', + { + roomType: ROOM_TYPE_EACH, + }, + { withCredentials: true }, + ); setRoomId(data.data.id); setCurrentView('shareLink'); } else { - const { data } = await axios.post(BACKEND_URL + '/api/rooms', { - roomType: ROOM_TYPE_ALONE, - }); + const { data } = await axios.post( + BACKEND_URL + '/api/rooms', + { + roomType: ROOM_TYPE_ALONE, + }, + { + withCredentials: true, + }, + ); const newRoomId = data.data.id; navigate(`/page/a/results/${newRoomId}`); }