File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ export default function Navbar() {
3838 toast . warning ( '예매내역이 삭제되었습니다.' ) ;
3939 return queryClient . refetchQueries ( { queryKey : [ 'reservation' ] } ) ;
4040 } ,
41+ onError : ( ) => {
42+ toast . error ( '예매내역 삭제에 실패했습니다.\n 잠시 후 다시 시도해주세요' ) ;
43+ } ,
4144 } ) ;
4245
4346 const deletingReservationIdList = useMutationState ( {
@@ -47,9 +50,9 @@ export default function Navbar() {
4750
4851 const { mutate : requestLogout } = useMutation ( {
4952 mutationFn : postLogout ,
50- onError : ( ) => { } ,
5153 onSuccess : ( ) => {
5254 if ( logout ) logout ( ) ;
55+ toast . warning ( '로그아웃 되었습니다' ) ;
5356 } ,
5457 } ) ;
5558
Original file line number Diff line number Diff line change @@ -3,11 +3,16 @@ import { Navigate } from 'react-router-dom';
33
44import { useAuthContext } from '@/hooks/useAuthContext.tsx' ;
55
6+ import { toast } from '@/components/Toast/index.ts' ;
7+
68import { ROUTE_URL } from '@/constants/index.ts' ;
79
810//TODO toast 알림 추가 필ㄹ요
911export default function WithLogin ( { children } : PropsWithChildren ) {
1012 const { isLogin } = useAuthContext ( ) ;
11- if ( ! isLogin ) return < Navigate to = { ROUTE_URL . USER . LOGIN } /> ;
13+ if ( ! isLogin ) {
14+ toast . warning ( '로그인이 필요한 서비스입니다.\n로그인 후 이용해주세요.' ) ;
15+ return < Navigate to = { ROUTE_URL . USER . LOGIN } /> ;
16+ }
1217 return < > { children } </ > ;
1318}
Original file line number Diff line number Diff line change @@ -3,10 +3,15 @@ import { Navigate } from 'react-router-dom';
33
44import { useAuthContext } from '@/hooks/useAuthContext.tsx' ;
55
6+ import { toast } from '@/components/Toast/index.ts' ;
7+
68import { ROUTE_URL } from '@/constants/index.ts' ;
79
810export default function WithoutLogin ( { children } : PropsWithChildren ) {
911 const { isLogin } = useAuthContext ( ) ;
10- if ( isLogin ) return < Navigate to = { ROUTE_URL . PROGRAM . DEFAULT } /> ;
12+ if ( isLogin ) {
13+ toast . warning ( '로그인 후 접근할 수 없습니다.\n로그 아웃 후 이용해주세요.' ) ;
14+ return < Navigate to = { ROUTE_URL . PROGRAM . DEFAULT } /> ;
15+ }
1116 return < > { children } </ > ;
1217}
You can’t perform that action at this time.
0 commit comments