Skip to content

Commit

Permalink
fix: window.confirm -> toast 메시지 대체
Browse files Browse the repository at this point in the history
  • Loading branch information
mintmin0320 committed Apr 8, 2024
1 parent d5746cc commit 5ec1465
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/app/_hook/common/useHandleApiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@ export const useHandleApiError = () => {
return (error: ApiError) => {
switch (error.code) {
case ERROR_CODE.INSUFFICIENT_PERMISSION:
if (window.confirm(ERROR_MESSAGE.PROFILE_COMPLETION_REQUIRED)) {
router.push('/join')
}
renderToast({
type: 'error',
message: ERROR_MESSAGE.PROFILE_COMPLETION_REQUIRED,
})

router.push('/join')

break

case ERROR_CODE.INVALID_ACCESS_TOKEN:
if (window.confirm(ERROR_MESSAGE.LOGIN_REQUIRED)) {
router.push('/login')
}
renderToast({ type: 'error', message: ERROR_MESSAGE.LOGIN_REQUIRED })

router.push('/login')

break

default:
Expand Down

0 comments on commit 5ec1465

Please sign in to comment.