Skip to content

Commit

Permalink
show rc list numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Dec 6, 2023
1 parent 082717b commit b4883b9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pages/board/rc-students-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PoPoAxios } from '@/utils/axios.instance';
import CsvUploadForm from '@/components/common/csv-upload.form';
import { Button } from 'semantic-ui-react';

const RcStudentsListPage = ({ rcStdntCnt }) => {
const RcStudentsListPage = ({ popoRcStdntCnt, totalRcStdntCnt }) => {
return (
<BoardLayout>
<h3>RC 사생 명단 업로드</h3>
Expand All @@ -15,7 +15,14 @@ const RcStudentsListPage = ({ rcStdntCnt }) => {
</div>

<div style={{marginTop: 4}}>
현재 RC 사생 수: {rcStdntCnt}
<ul>
<li>
POPO 가입 RC 사생 수: {popoRcStdntCnt}명 ({Number((popoRcStdntCnt / totalRcStdntCnt * 100).toFixed(1))}%)
</li>
<li>
전체 RC 사생 수: {totalRcStdntCnt}
</li>
</ul>
</div>

<div style={{marginTop: 4, gap: 8}}>
Expand Down Expand Up @@ -47,8 +54,11 @@ const RcStudentsListPage = ({ rcStdntCnt }) => {
export default RcStudentsListPage;

export async function getServerSideProps() {
const res = await PoPoAxios.get('/user/count/RC_STUDENT');
const rcStdntCnt = res.data;
const res1 = await PoPoAxios.get('/user/count/RC_STUDENT');
const popoRcStdntCnt = res1.data;

const res2 = await PoPoAxios.get('/setting/count-rc-student-list');
const totalRcStdntCnt = res2.data;

return { props: { rcStdntCnt } }
return { props: { popoRcStdntCnt, totalRcStdntCnt } }
}

0 comments on commit b4883b9

Please sign in to comment.