Browse Source

update condition

pull/1/head
farhan048 1 year ago
parent
commit
c6880d8236
  1. 8
      src/views/SimproV2/CreatedProyek/index.js

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

@ -102,14 +102,13 @@ const CreatedProyek = ({ params, ...props }) => {
user_id = props.location.state.user_id; user_id = props.location.state.user_id;
token = props.location.state.token; token = props.location.state.token;
isLogin = props.location.state.isLogin; isLogin = props.location.state.isLogin;
console.log('props.location.state success');
} else { } else {
role_id = localStorage.getItem("role_id"); role_id = localStorage.getItem("role_id");
proyek_id = localStorage.getItem("proyek_id"); proyek_id = localStorage.getItem("proyek_id");
user_id = localStorage.getItem("user_id"); user_id = localStorage.getItem("user_id");
token = localStorage.getItem("token"); token = localStorage.getItem("token");
isLogin = localStorage.getItem("isLogin"); isLogin = localStorage.getItem("isLogin");
console.error('Undefined in props.location.state');
} }
const history = useHistory(); const history = useHistory();
const HEADER = { const HEADER = {
@ -210,7 +209,10 @@ const CreatedProyek = ({ params, ...props }) => {
}, [openDialogProyek]); }, [openDialogProyek]);
useEffect(() => { useEffect(() => {
parseInt(role_id) !== 44 ? getDataProyek() : getDataProyekByCustomer(); if (parseInt(role_id) === 44) {
getDataProyekByCustomer()
}
getDataProyek();
}, [search, rowsPerPage, currentPage]); }, [search, rowsPerPage, currentPage]);
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save