-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[#102] 로그아웃 API 연결
- Loading branch information
Showing
8 changed files
with
113 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// import { AxiosError } from 'axios'; | ||
|
||
import { instance } from '..'; | ||
|
||
const postLogout = async () => { | ||
await instance.post('/v1/member/logout'); | ||
|
||
/* HACK: 로그아웃 에러 response 가 있을 경우 사용 | ||
try { | ||
const response = await instance.post('/v1/member/logouts'); | ||
return response; | ||
} catch (error) { | ||
if (error instanceof AxiosError) error.response; | ||
} | ||
*/ | ||
}; | ||
|
||
export default postLogout; |
74 changes: 66 additions & 8 deletions
74
src/components/common/Layout/Header/User/UserModal/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const ERROR_MODAL_MESSAGE = { | ||
LOGIN: { | ||
text: '이메일 또는 비밀번호를 잘못 입력했습니다.', | ||
errorText: '입력하신 내용을 다시 확인해주세요.' | ||
}, | ||
USER_MODAL: { | ||
text: '로그아웃에 실패하였습니다.', | ||
errorText: '잠시후 재시도 해주세요.' | ||
} | ||
}; | ||
|
||
export default ERROR_MODAL_MESSAGE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters