Skip to content

Commit

Permalink
feat: mypage 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seung365 committed Aug 7, 2024
1 parent d8ba137 commit 76ef594
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/MyPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));
Expand Down

0 comments on commit 76ef594

Please sign in to comment.