From 2726581537140169bd821aa4b1b95abb742af5d7 Mon Sep 17 00:00:00 2001 From: afds4567 <33995840+afds4567@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:41:41 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83?= =?UTF-8?q?=20post=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20(#468)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/MyInfo/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/MyInfo/index.tsx b/frontend/src/components/MyInfo/index.tsx index 463678c99..e1e331ec1 100644 --- a/frontend/src/components/MyInfo/index.tsx +++ b/frontend/src/components/MyInfo/index.tsx @@ -8,7 +8,7 @@ import { ProfileProps } from '../../types/Profile'; import UpdateMyInfo from './UpdateMyInfo'; import Button from '../common/Button'; import useToast from '../../hooks/useToast'; -import { postApi } from '../../apis/postApi'; +import { DEFAULT_PROD_URL } from '../../constants'; const user = JSON.parse(localStorage.getItem('user') || '{}'); const accessToken = localStorage.getItem('userToken'); @@ -25,13 +25,16 @@ const MyInfo = () => { const onClickLogout = async (e: React.MouseEvent) => { try { - await postApi( - `/logout`, - { - accessToken: accessToken, + fetch(`${DEFAULT_PROD_URL}/logout`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Authorization: `Bearer ${accessToken}`, }, - 'x-www-form-urlencoded', - ); + body: JSON.stringify({ + accessToken: accessToken, + }), + }); localStorage.removeItem('user'); localStorage.removeItem('userToken');