Skip to content

Commit

Permalink
feat: query clear 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook authored and 임병욱 committed Feb 19, 2024
1 parent df1e423 commit e5c793b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/my-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useEffect, useState } from 'react';
import { useCookies } from 'react-cookie';

import { useQueryClient } from '@tanstack/react-query';
import classNames from 'classnames/bind';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
Expand All @@ -24,6 +25,7 @@ const cx = classNames.bind(styles);
function MyProfilePage() {
const router = useRouter();
const dispatch = useAppDispatch();
const query = useQueryClient();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [cookies, removeCookie] = useCookies(['token']);

Expand All @@ -41,6 +43,7 @@ function MyProfilePage() {
// TODO: 먼저 로그아웃 모달이 뜨도록 할지 논의필요
dispatch(clearUserId());
removeCookie('token', { path: '/' });
query.clear();
router.push('/');
};

Expand Down

0 comments on commit e5c793b

Please sign in to comment.