|
|
|
@ -96,20 +96,19 @@ const url = "";
|
|
|
|
|
const format = "DD-MM-YYYY"; |
|
|
|
|
|
|
|
|
|
const CreatedProyek = ({ params, ...props }) => { |
|
|
|
|
let role_id = '', user_id='',proyek_id='',isLogin='',token=''; |
|
|
|
|
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = ''; |
|
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
|
role_id = props.location.state.role_id; |
|
|
|
|
user_id = props.location.state.user_id; |
|
|
|
|
token = props.location.state.token; |
|
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
|
console.log('props.location.state success'); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
|
proyek_id = localStorage.getItem("proyek_id"); |
|
|
|
|
user_id = localStorage.getItem("user_id"); |
|
|
|
|
token = localStorage.getItem("token"); |
|
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
|
console.error('Undefined in props.location.state'); |
|
|
|
|
} |
|
|
|
|
const history = useHistory(); |
|
|
|
|
const HEADER = { |
|
|
|
@ -210,7 +209,10 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
}, [openDialogProyek]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
parseInt(role_id) !== 44 ? getDataProyek() : getDataProyekByCustomer(); |
|
|
|
|
if (parseInt(role_id) === 44) { |
|
|
|
|
getDataProyekByCustomer() |
|
|
|
|
} |
|
|
|
|
getDataProyek(); |
|
|
|
|
}, [search, rowsPerPage, currentPage]); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
@ -714,7 +716,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
if (result && result.data && result.data.code === 200) { |
|
|
|
|
setLoading(false) |
|
|
|
|
setProjectImage(result.data.data); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
setLoading(false) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1631,7 +1633,7 @@ const CreatedProyek = ({ params, ...props }) => {
|
|
|
|
|
dataIndex: "", |
|
|
|
|
key: "x", |
|
|
|
|
render: (text, record) => |
|
|
|
|
parseInt(role_id) == 44 ? ( |
|
|
|
|
parseInt(role_id) == 44 ? ( |
|
|
|
|
<> |
|
|
|
|
<Tooltip title="Dashboard Project"> |
|
|
|
|
<Button |
|
|
|
|