Browse Source

filter by company

pull/1/head
farhantock 11 months ago
parent
commit
a3cd51ce6c
  1. 26
      src/views/SimproV2/Divisi/index.js

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

@ -69,8 +69,31 @@ const ProjectType = ({ params, ...props }) => {
}, [dataExport])
const getListDivision = async () => {
const payload = {
columns: [],
"orders": {
"ascending": true,
"columns": [
'name'
]
},
"paging": {
"length": 0,
"start": -1
}
}
if (role_name !== "Super Admin") {
payload.columns.push(
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" },
)
} else {
payload.columns.push(
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" },
)
}
const listDivions = await axios
.get(DIVISI_LIST, HEADER)
.post(DIVISI_SEARCH, payload, HEADER)
.then(res => res)
.catch((error) => error.response);
@ -321,6 +344,7 @@ const ProjectType = ({ params, ...props }) => {
clickOpenModal={clickOpenModal}
dataParent={allDataMenu}
dataDivisions={dataDivisions}
company_id={company_id}
/>
<Card>
<CardHeader style={{ display: "flex", justifyContent: "space-between" }}>

Loading…
Cancel
Save