Browse Source

filter by hierarchy

pull/2/head
farhan048 1 year ago
parent
commit
4de2693554
  1. 1
      src/views/Pages/Login/Login.js
  2. 4
      src/views/SimproV2/CreatedProyek/index.js

1
src/views/Pages/Login/Login.js

@ -217,6 +217,7 @@ class Login extends Component {
window.localStorage.setItem('role_id', data_user.role_id);
window.localStorage.setItem('company_id', data_user.company_id);
window.localStorage.setItem('role_name', data_user.role.name);
window.localStorage.setItem('hierarchy', JSON.stringify(data_user.hierarchy));
} else {
console.log("kode : ", doLogin.data.code);
// NotificationManager.error('Cek username atau password anda!', 'Gagal Login!');

4
src/views/SimproV2/CreatedProyek/index.js

@ -292,7 +292,8 @@ const CreatedProyek = ({ params, ...props }) => {
const getDataProyek = async () => {
let start = 0;
let hierarchy = [];
hierarchy.push(JSON.parse(localStorage.getItem("hierarchy")));
if (currentPage !== 1 && currentPage > 1) {
start = currentPage * rowsPerPage - rowsPerPage;
}
@ -335,6 +336,7 @@ const CreatedProyek = ({ params, ...props }) => {
if (parseInt(role_id) !== 1) {
payload["columns"] = [
{ name: "id", logic_operator: "=", value: proyek_id, operator: "AND" },
{ name: "created_by_id", logic_operator: "IN", value: hierarchy, operator: "AND" }
];
}

Loading…
Cancel
Save