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