Skip to content

Commit

Permalink
fix: post요청
Browse files Browse the repository at this point in the history
  • Loading branch information
Cllaude99 committed Sep 28, 2024
1 parent 4ec14b6 commit cf55e17
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/components/Modal/PlaceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit cf55e17

Please sign in to comment.