Skip to content

Commit

Permalink
#247 feat: 전체 통계 API 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjeonghyun committed Sep 14, 2024
1 parent 9c0cb2b commit 82e010c
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/pages/TotalStatisticsPage/TotalStatisticsPage.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
import * as S from './TotalStatisticsPage.style';
import { PageLayout } from '@/Layout';
import { TopNavigation } from '@/components';
import { axiosInstance } from '@/axios';
import { Dropdown, TopNavigation } from '@/components';
import { useEffect, useState } from 'react';

const TotalStatisticsPage = () => {
const USER_ID = sessionStorage.getItem('id');
const [viewMode, setViewMode] = useState('그래프');

useEffect(() => {
const fetchStatistics = async () => {
try {
const statisticsResponse = await axiosInstance.get(
`/api/v1/events/statistic/student/100?memberId=${USER_ID}&authority=MEMBER&member=true`,
);

console.log(statisticsResponse);
} catch (error) {
console.error('Error fetching statistics:', error);
}
};

fetchStatistics();
}, []);

return (
<PageLayout topNavigation={<TopNavigation />}>
<S.Container>
<S.TotalStatisticsPage>
<div> HI 👋 </div>
<Dropdown
items={['그래프', '표']}
defaultItem={'그래프'}
onSelect={setViewMode}
/>
</S.TotalStatisticsPage>
</S.Container>
</PageLayout>
Expand Down

0 comments on commit 82e010c

Please sign in to comment.