From b4883b9fc1d0bc48bcf0a760ede26e627af4bc1e Mon Sep 17 00:00:00 2001 From: bluehorn07 Date: Thu, 7 Dec 2023 00:35:45 +0900 Subject: [PATCH] show rc list numbers --- pages/board/rc-students-list.jsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/board/rc-students-list.jsx b/pages/board/rc-students-list.jsx index c3294c8..2aec4f3 100644 --- a/pages/board/rc-students-list.jsx +++ b/pages/board/rc-students-list.jsx @@ -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 (

RC 사생 명단 업로드

@@ -15,7 +15,14 @@ const RcStudentsListPage = ({ rcStdntCnt }) => {
- 현재 RC 사생 수: {rcStdntCnt}명 +
    +
  • + POPO 가입 RC 사생 수: {popoRcStdntCnt}명 ({Number((popoRcStdntCnt / totalRcStdntCnt * 100).toFixed(1))}%) +
  • +
  • + 전체 RC 사생 수: {totalRcStdntCnt}명 +
  • +
@@ -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 } } }