Skip to content

Commit

Permalink
Fix: 마일리지 학기별 항목의 보이기 값이 boolean임에 맞춰 데이터를 true/false로 변경(#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinhyuk committed Aug 25, 2023
1 parent f2a314f commit b432ad7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/components/board/MileageSemesterItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default function MileageSemesterItem() {
'2022-01',
'웹 서비스 캠프',
30,
'y',
true,
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />
Expand All @@ -188,7 +188,7 @@ export default function MileageSemesterItem() {
'2022-01',
'웹 서비스 캠프',
30,
'y',
true,
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />
Expand All @@ -199,7 +199,7 @@ export default function MileageSemesterItem() {
'2022-01',
'웹 서비스 캠프',
30,
'y',
true,
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />
Expand All @@ -210,7 +210,7 @@ export default function MileageSemesterItem() {
'2022-01',
'웹 서비스 캠프',
30,
'y',
false,
'2023-08-21',

<SWModal type={EDITITEM} beforeData={IParams} />
Expand All @@ -221,7 +221,7 @@ export default function MileageSemesterItem() {
'2022-02',
'웹 서비스 캠프',
30,
'y',
true,
'2023-08-21',
<SWModal type={EDITITEM} beforeData={IParams} />
),
Expand All @@ -231,7 +231,7 @@ export default function MileageSemesterItem() {
'2022-02',
'웹 서비스 캠프',
30,
'y',
false,
'2023-08-21',
<SWModal type={EDITITEM} beforeData={IParams} />
),
Expand Down
10 changes: 8 additions & 2 deletions src/components/common/CustomTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ import { useEffect } from 'react';
import { setMileageCategoryList } from 'src/redux/slices/data';
import SemesterDropdown from './Filter/SemesterDropdown';
import { id } from 'date-fns/locale';
import isVisibleDropdown from './Filter/IsVisibleDropdown';

import IsVisibleDropdown from './Filter/IsVisibleDropdown';
import ItemAutoComplete from './Filter/ItemAutoComplete';

/**
* @brief 반응형 구축
Expand Down Expand Up @@ -225,6 +226,7 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) {
<CategoryAutoComplete />
<SemesterDropdown />
<IsVisibleDropdown />
<ItemAutoComplete />
</Box>

{/* 학기 필터링 */}
Expand Down Expand Up @@ -304,6 +306,7 @@ export default function EnhancedTable({ originalRows, headCells, type }) {
const category = useSelector((state) => state.filter.category);
const semester = useSelector((state) => state.filter.semester);
const isVisible = useSelector((state) => state.filter.isVisible);
const item = useSelector((state) => state.filter.item);
/**
* @brief 필터링
*/
Expand All @@ -320,12 +323,15 @@ export default function EnhancedTable({ originalRows, headCells, type }) {
copyRows = copyRows.filter((row) => row.isVisible === isVisible);
console.log(copyRows[0]?.isVisible, isVisible);
}
if (item && item !== '전체') {
copyRows = copyRows.filter((row) => row.item === item);
}
setRows(copyRows);

// !category
// ? setRows(originalRows)
// : setRows(originalRows.filter((row) => row.category === category));
}, [category, semester, isVisible]);
}, [category, semester, isVisible, item]);

const [order, setOrder] = React.useState<Order>('asc');
const [orderBy, setOrderBy] = React.useState<keyof Data>('calories');
Expand Down

0 comments on commit b432ad7

Please sign in to comment.