fix: error fix

main
minuk926 2 years ago
parent fbc090bfb7
commit 0f7ba1f1c5

@ -53,26 +53,29 @@ const JudgeReview = ({ msDatagb, menuName }) => {
});
const [judgeDatas, setJudgeDatas] = useState([]);
const search = useCallback(async () => {
const params = {
msDatagb,
msYear: selectedYear,
msChasu: inputRef.current,
page: rowsState.page,
size: rowsState.pageSize
};
const search = useCallback(
async (datagb) => {
const params = {
msDatagb: datagb ?? msDatagb,
msYear: selectedYear,
msChasu: inputRef.current,
page: rowsState.page,
size: rowsState.pageSize
};
let res = {};
if (msDatagb) {
res = await findJudges(params);
} else {
res = await findParkings(params);
}
if (res && res.data) {
setTotalCount(res.count);
setRowsState((prevState) => ({ ...prevState, rows: res.data }));
}
}, [msDatagb, rowsState.page, rowsState.pageSize, selectedYear]);
let res = {};
if (datagb ?? msDatagb) {
res = await findJudges(params);
} else {
res = await findParkings(params);
}
if (res && res.data) {
setTotalCount(res.count);
setRowsState((prevState) => ({ ...prevState, rows: res.data }));
}
},
[msDatagb, rowsState.page, rowsState.pageSize, selectedYear]
);
const deleteJudge = useCallback(
(row) => () => {
@ -91,7 +94,7 @@ const JudgeReview = ({ msDatagb, menuName }) => {
...rowsState,
page: 0
});
search();
search(datagb);
} else {
showAlert.show(res.message);
}

@ -120,6 +120,13 @@ const Dashboard = () => {
align: 'center',
width: 95,
valueGetter: (params) => `${params.row.jcnt} / ${params.row.tcnt}`
},
{
headerName: '종료일',
headerAlign: 'center',
field: 'msEdate',
align: 'center',
width: 95
}
];
@ -138,17 +145,17 @@ const Dashboard = () => {
const parkRows = res.data.parkJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
setMsEdate1(parkRows[0]?.msEdate);
setTotalCount1(parkRows.count);
setTotalCount1(parkRows.length);
setRowsState1((prevState) => ({ ...prevState, rows: parkRows }));
const residentRows = res.data.residentJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
setMsEdate2(residentRows[0]?.msEdate);
setTotalCount2(residentRows.count);
setTotalCount2(residentRows.length);
setRowsState2((prevState) => ({ ...prevState, rows: residentRows }));
const disabledRows = res.data.disabledJudgeList.map((d, idx) => ({ ...d, rowId: idx + 1 }));
setMsEdate3(disabledRows[0]?.msEdate);
setTotalCount3(disabledRows.count);
setTotalCount3(disabledRows.length);
setRowsState3((prevState) => ({ ...prevState, rows: disabledRows }));
} else {
showAlert.show(res.data.methodName);

Loading…
Cancel
Save