Skip to content

Commit

Permalink
Fix: 마일리지 글로벌 항목 학기 , 마일리지 , 최대 마일리지 삭제(#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Aug 29, 2023
1 parent 36fdffb commit 34b188b
Showing 1 changed file with 24 additions and 42 deletions.
66 changes: 24 additions & 42 deletions src/pages/mileage/item/global/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ import { useEffect } from 'react';
export enum MileageGlobalItemBoard {
'NUM' = NUM,
'CATEGORY' = CATEGORY,
'SEMESTER' = SEMESTER,

'ITEM' = ITEM,
'MILEAGE' = MILEAGE,

'ISVISIBLE' = ISVISIBLE,
'REGISTERED_DATE' = REGISTERED_DATE,
'MANAGE' = MANAGE,
Expand All @@ -55,9 +55,9 @@ export enum MileageGlobalItemBoard {
*/
interface Data {
[MileageGlobalItemBoard.CATEGORY]: string;
[MileageGlobalItemBoard.SEMESTER]: string;

[MileageGlobalItemBoard.ITEM]: string;
[MileageGlobalItemBoard.MILEAGE]: number;

[MileageGlobalItemBoard.ISVISIBLE]: boolean;
[MileageGlobalItemBoard.REGISTERED_DATE]: string;
[MileageGlobalItemBoard.MANAGE]: string;
Expand All @@ -71,19 +71,19 @@ interface Data {
function createData(
num: number,
category: string,
semester: string,

item: string,
mileage: number,

isVisible: boolean,
registeredDate: string,
manage: string
): Data {
return {
[MileageGlobalItemBoard.NUM]: num,
[MileageGlobalItemBoard.CATEGORY]: category,
[MileageGlobalItemBoard.SEMESTER]: semester,

[MileageGlobalItemBoard.ITEM]: item,
[MileageGlobalItemBoard.MILEAGE]: mileage,

[MileageGlobalItemBoard.ISVISIBLE]: isVisible,
[MileageGlobalItemBoard.REGISTERED_DATE]: registeredDate,
[MileageGlobalItemBoard.MANAGE]: manage,
Expand All @@ -107,24 +107,12 @@ const headCells = [
disablePadding: false,
label: '카테고리명',
},
{
id: [MileageGlobalItemBoard.SEMESTER],
numeric: true,
disablePadding: false,
label: '학기',
},
{
id: [MileageGlobalItemBoard.ITEM],
numeric: true,
disablePadding: false,
label: '항목명',
},
{
id: [MileageGlobalItemBoard.MILEAGE],
numeric: true,
disablePadding: false,
label: '마일리지',
},
{
id: [MileageGlobalItemBoard.ISVISIBLE],
numeric: true,
Expand All @@ -147,10 +135,8 @@ const headCells = [

const IParams = {
[CATEGORY]: '카테고리테스트',
[SEMESTER]: '2022-01',
[ITEM]: '웹 서비스 캠프',
[MILEAGE]: 30,
[MAX_MAILEAGE]: 50,

[DESCRIPTION1]: '설명 1',
[DESCRIPTION2]: '설명 2',
[FILE_DESCRIPTION]: '첨부파일 설명',
Expand All @@ -170,14 +156,13 @@ const IParams = {
* @description 마일리지 항목 리스트
*/


const rows = [
createData(
1,
'전공 마일리지',
'2022-01',

'웹 서비스 캠프',
30,

true,
'2023-08-21',

Expand All @@ -186,9 +171,9 @@ const rows = [
createData(
2,
'비교과 - 연구활동',
'2022-01',

'웹 서비스 캠프',
30,

true,
'2023-08-21',

Expand All @@ -197,9 +182,9 @@ const rows = [
createData(
3,
'비교과 - 전공활동',
'2022-01',

'웹 서비스 캠프',
30,

false,
'2023-08-21',

Expand All @@ -208,9 +193,9 @@ const rows = [
createData(
4,
'비교과 - 특강참여',
'2022-01',

'웹 서비스 캠프',
30,

false,
'2023-08-21',

Expand All @@ -219,19 +204,19 @@ const rows = [
createData(
5,
'비교과 - 학회활동',
'2022-02',

'웹 서비스 캠프',
30,

true,
'2023-08-21',
<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
),
createData(
6,
'비교과 - 행사참여',
'2022-02',

'웹 서비스 캠프',
30,

true,
'2023-08-21',
<SWModal type={EDITGLOBALITEM} beforeData={IParams} />
Expand All @@ -241,6 +226,7 @@ const rows = [
import axiosInstance from 'src/utils/axios';
import { InferGetServerSidePropsType, GetServerSideProps } from 'next';
import MileageCategory from 'src/components/board/MileageCategory';
import { setSemesterList } from 'src/redux/slices/filter';

interface ICategory {
id: number;
Expand Down Expand Up @@ -275,7 +261,6 @@ export const getServerSideProps: GetServerSideProps<{
export default function MileageCategory({
fetchData,
}: InferGetServerSidePropsType<typeof getServerSideProps>) {

/**
* 리액트 메모를 쓰거나 하면 성능 최적화가 될것 같은..
*/
Expand All @@ -288,10 +273,8 @@ export default function MileageCategory({
const beforeData = {
[NUM]: item.id,
[CATEGORY]: item.category.name,
[SEMESTER]: '2022-01', // 없어야 되는 값

[ITEM]: item.itemName,
[MILEAGE]: 30, //없어야 되는 값
[MAX_MAILEAGE]: 50, // 없어야 되는 값
[DESCRIPTION1]: item.description1,
[DESCRIPTION2]: item.description2,
[FILE_DESCRIPTION]: '첨부파일 설명', // 업서야 되는 듯
Expand All @@ -306,9 +289,8 @@ export default function MileageCategory({
return createData(
item.id,
item.category.name,
'2022-01',

item.itemName,
30,
true,
'2023-08-21',
<SWModal type={EDITGLOBALITEM} beforeData={beforeData} />
Expand Down

0 comments on commit 34b188b

Please sign in to comment.