Browse Source

remove company id from menu

pull/2/head
farhan048 1 year ago
parent
commit
ed163d2acc
  1. 3
      src/views/Master/MasterMenu/DialogForm.js
  2. 12
      src/views/Master/MasterMenu/index.js

3
src/views/Master/MasterMenu/DialogForm.js

@ -7,7 +7,6 @@ import 'antd/dist/antd.css';
import { useTranslation } from 'react-i18next';
const { Option } = Select
const company_id = window.localStorage.getItem('company_id');
const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdit, dataMenu }) => {
const [id, setId] = useState(0)
const [name, setName] = useState('')
@ -69,7 +68,6 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi
sequence: parseInt(sequence),
icon,
alias_name: aliasName,
company_id
}
if (parentId && parentId > 0) {
@ -85,7 +83,6 @@ const DialogForm = ({ openDialog, closeDialog, toggleDialog, typeDialog, dataEdi
sequence: parseInt(sequence),
icon,
alias_name: aliasName,
company_id
}
if (parentId && parentId > 0) {

12
src/views/Master/MasterMenu/index.js

@ -10,8 +10,6 @@ import { NotificationContainer, NotificationManager } from 'react-notifications'
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" },
@ -106,16 +104,6 @@ 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)

Loading…
Cancel
Save