|
|
|
@ -11,6 +11,7 @@ import { Pagination, Tooltip, Table } from 'antd';
|
|
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
const token = window.localStorage.getItem('token'); |
|
|
|
|
const company_id = window.localStorage.getItem('company_id'); |
|
|
|
|
const role_name = window.localStorage.getItem('role_name'); |
|
|
|
|
const column = [ |
|
|
|
|
{ name: "Nama" }, |
|
|
|
|
{ name: "Url" }, |
|
|
|
@ -94,8 +95,7 @@ const Index = ({ params }) => {
|
|
|
|
|
const payload = { |
|
|
|
|
"paging": { "start": start, "length": rowsPerPage }, |
|
|
|
|
"columns": [ |
|
|
|
|
{ "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" }, |
|
|
|
|
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
|
|
|
|
{ "name": "name", "logic_operator": "ilike", "value": search, "operator": "AND" } |
|
|
|
|
], |
|
|
|
|
"joins": [{ |
|
|
|
|
"name": "m_menu", |
|
|
|
@ -106,6 +106,16 @@ const Index = ({ params }) => {
|
|
|
|
|
}], |
|
|
|
|
"orders": { "columns": ["id"], "ascending": false } |
|
|
|
|
} |
|
|
|
|
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 result = await axios |
|
|
|
|
.post(MENU_SEARCH, payload, config) |
|
|
|
|