From 76ef594f73cdf6dad9c4635a8edb2ddca359842c Mon Sep 17 00:00:00 2001 From: seung365 Date: Thu, 8 Aug 2024 04:40:54 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20mypage=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyPage/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/MyPage/index.tsx b/src/pages/MyPage/index.tsx index 03c4805..88a0593 100644 --- a/src/pages/MyPage/index.tsx +++ b/src/pages/MyPage/index.tsx @@ -14,7 +14,7 @@ import { } from '@chakra-ui/react'; import { useGetMailBusiness } from '@/api/hooks/Mail/useGetMailBusiness'; import { useGetMailUniv } from '@/api/hooks/Mail/useGetMailUniv'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; export const MyPage = () => { const { authInfo } = useAuth(); @@ -27,6 +27,14 @@ export const MyPage = () => { const { univData, univLoading, univError } = useGetMailUniv(univPage, 5); const { businessData, businessLoading, businessError } = useGetMailBusiness(businessPage, 5); + useEffect(() => { + if (isJob === 'univ') { + setUnivPage(0); + } else { + setBusinessPage(0); + } + }, [isJob]); + const handlePrev = () => { if (isJob === 'univ') { setUnivPage((prev) => Math.max(prev - 1, 0));