Browse Source

add filter in frontend

pull/2/head
wahyuun 1 year ago
parent
commit
b28d679145
  1. 9
      src/views/SimproV2/Divisi/index.js

9
src/views/SimproV2/Divisi/index.js

@ -72,8 +72,10 @@ const ProjectType = ({ params }) => {
if (listDivions && listDivions.data && listDivions.data.code == 200) { if (listDivions && listDivions.data && listDivions.data.code == 200) {
let arr = [] let arr = []
for (const v in listDivions.data.data) { let dataRes = listDivions.data.data;
arr.push(listDivions.data.data[v]) const filteredData = dataRes.filter(item => item.parent === null);
for (const v in filteredData) {
arr.push(filteredData[v])
} }
setDataDivisions(arr); setDataDivisions(arr);
} else { } else {
@ -183,7 +185,8 @@ const ProjectType = ({ params }) => {
}; };
const handleOpenDialog = (type) => { const handleOpenDialog = (type) => {
setOpenDialog(true) setOpenDialog(true)
getListDivision();
setTypeDialog(type) setTypeDialog(type)
} }

Loading…
Cancel
Save