diff --git a/src/views/SimproV2/ResourceWorker/index.js b/src/views/SimproV2/ResourceWorker/index.js index e7e9c78..ada1de8 100644 --- a/src/views/SimproV2/ResourceWorker/index.js +++ b/src/views/SimproV2/ResourceWorker/index.js @@ -87,7 +87,17 @@ const ResourceWorker = ({ params, ...props }) => { const getRoleList = async () => { const formData = { "paging": { "start": 0, "length": -1 }, - "orders": { "columns": ["id"], "ascending": false } + "orders": { "columns": ["id"], "ascending": false }, + "columns": [], + } + if (role_name !== "Super Admin") { + formData.columns.push( + { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, + ) + } else { + formData.columns.push( + { "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" }, + ) } const result = await axios @@ -103,7 +113,18 @@ const ResourceWorker = ({ params, ...props }) => { const getDivisiList = async () => { const formData = { "paging": { "start": 0, "length": -1 }, - "orders": { "columns": ["id"], "ascending": false } + "orders": { "columns": ["id"], "ascending": false }, + "columns": [], + } + + if (role_name !== "Super Admin") { + formData.columns.push( + { "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, + ) + } else { + formData.columns.push( + { "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" }, + ) } const result = await axios @@ -248,12 +269,6 @@ const ResourceWorker = ({ params, ...props }) => { } - const handleSync = async () => { - await axios.get(USER_SYNC, HEADER) - .then(res => res) - .catch((error) => error.response) - } - const handleExportExcel = async () => { let start = 0; @@ -580,9 +595,6 @@ const ResourceWorker = ({ params, ...props }) => { - - -