Skip to content

Commit

Permalink
Merge pull request #102 from Beside-Potenday/seungbeom
Browse files Browse the repository at this point in the history
fix: 버그 수정
  • Loading branch information
seung365 authored Aug 8, 2024
2 parents ad965e4 + 8f2c3be commit 9594c9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/MyPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ export const MyPage = () => {
const [isJob, setIsJob] = useState('univ');
const [page, setPage] = useState(0);

const { mailData, mailLoading, mailError } = useGetMail(page, 5, isJob);
const { mailData, mailLoading, mailError, refetch } = useGetMail(page, 5, isJob);

useEffect(() => {
window.scrollTo(0, 0);
}, []);

useEffect(() => {
setPage(0);
}, [isJob]);
refetch(); // isJob이 변경될 때 데이터를 리프레시합니다.
}, [isJob, refetch]);

const handlePrev = () => {
setPage((prev) => Math.max(prev - 1, 0));
Expand Down

0 comments on commit 9594c9e

Please sign in to comment.