Skip to content

Commit

Permalink
Feat: 마일리지 글로벌 항목에서 하위 학기별 항목 수를 나타내는 필드 추가(#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Oct 11, 2023
1 parent f436257 commit ba8ee30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/assets/data/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ export const LEVEL = 'level';
export const TYPE = 'type';

export const ITEM_COUNT = 'itemCount';
export const SEMESTER_ITEM_COUNT = 'semesterItemCount';
17 changes: 12 additions & 5 deletions src/pages/mileage/item/global/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export enum MileageGlobalItemBoard {
'ITEM' = ITEM,
'DESCRIPTION1' = DESCRIPTION1,
'DESCRIPTION2' = DESCRIPTION2,

'SEMESTER_ITEM_COUNT' = SEMESTER_ITEM_COUNT,
'ISVISIBLE' = ISVISIBLE,
'MOD_DATE' = MOD_DATE,
'MANAGE' = MANAGE,
Expand All @@ -59,7 +59,7 @@ interface Data {
[MileageGlobalItemBoard.ITEM]: string;
[MileageGlobalItemBoard.DESCRIPTION1]: string;
[MileageGlobalItemBoard.DESCRIPTION2]: string;

[MileageGlobalItemBoard.SEMESTER_ITEM_COUNT]: number;
[MileageGlobalItemBoard.ISVISIBLE]: boolean;
[MileageGlobalItemBoard.MOD_DATE]: string;
[MileageGlobalItemBoard.MANAGE]: string;
Expand All @@ -76,7 +76,7 @@ function createData(
ITEM: string,
DESCRIPTION1: string,
DESCRIPTION2: string,

SEMESTER_ITEM_COUNT: number,
ISVISIBLE: boolean,
MOD_DATE: string,
MANAGE: string
Expand All @@ -89,7 +89,7 @@ function createData(

[MileageGlobalItemBoard.DESCRIPTION1]: DESCRIPTION1,
[MileageGlobalItemBoard.DESCRIPTION2]: DESCRIPTION2,

[MileageGlobalItemBoard.SEMESTER_ITEM_COUNT]: SEMESTER_ITEM_COUNT,
[MileageGlobalItemBoard.ISVISIBLE]: ISVISIBLE,
[MileageGlobalItemBoard.MOD_DATE]: MOD_DATE,
[MileageGlobalItemBoard.MANAGE]: MANAGE,
Expand Down Expand Up @@ -131,6 +131,12 @@ const headCells = [
disablePadding: false,
label: '설명2',
},
{
id: [MileageGlobalItemBoard.SEMESTER_ITEM_COUNT],
numeric: true,
disablePadding: false,
label: '학기별 항목 수',
},
{
id: [MileageGlobalItemBoard.ISVISIBLE],
numeric: true,
Expand Down Expand Up @@ -245,7 +251,7 @@ import axiosInstance from 'src/utils/axios';
import { InferGetServerSidePropsType, GetServerSideProps } from 'next';
import MileageCategory from 'src/components/board/MileageCategory';
import { setItemList, setSemesterList } from 'src/redux/slices/filter';
import { ID, CATEGORY, ITEM, ISVISIBLE } from '../../../../assets/data/fields';
import { ID, CATEGORY, ITEM, ISVISIBLE, SEMESTER_ITEM_COUNT } from '../../../../assets/data/fields';

interface ICategory {
id: number;
Expand Down Expand Up @@ -317,6 +323,7 @@ export default function MileageCategory({
item[NAME],
item[DESCRIPTION1],
item[DESCRIPTION2],
item[SEMESTER_ITEM_COUNT],
item[ISVISIBLE],
item[MOD_DATE],
<SWModal type={EDITGLOBALITEM} beforeData={beforeData} />
Expand Down

0 comments on commit ba8ee30

Please sign in to comment.