Commit 6719d428 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

hp

See merge request !493
parents 3d1f3560 6753ee3c
......@@ -34,8 +34,6 @@ export default class getAllDocument extends Component {
componentDidMount() {
this.getData()
console.log(this.props.allsubcoEdit)
console.log(this.props.btnedit)
}
componentWillReceiveProps(props) {
......
......@@ -21,7 +21,8 @@ class HomePage extends Component {
{ nama: 'Puninar Infinite Raya', status: 'complete' },
{ nama: 'Dharma Group', status: 'overdue' },
{ nama: 'Daya Group', status: 'open' },
]
],
isApprover: true
}
}
......@@ -36,15 +37,16 @@ class HomePage extends Component {
}
}
})
api.create().checkApprover().then(response => {
console.log(response);
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true }, () =>
this.getDashboard())
} else {
this.setState({ isApprover: false })
}
})
// api.create().checkApprover().then(response => {
// console.log(response);
// if (response.data.data.is_approver === true) {
// this.setState({ isApprover: true }, () =>
// this.getDashboard())
// } else {
// this.setState({ isApprover: false })
// }
// })
this.getApprMat()
}
componentDidUpdate() {
......@@ -68,6 +70,24 @@ class HomePage extends Component {
})
}
getApprMat() {
api.create().getAM().then((response) => {
console.log(response);
let actAM = response.data.data.map((item, index) => {
if(String(item.status).toLocaleLowerCase() == 'active'){
return item
}
})
let userId = localStorage.getItem(Constant.USER)
let indexId = actAM.findIndex((val) => val.user_id == userId)
if (indexId === -1){
this.setState({ isApprover: false })
}
console.log(actAM)
})
}
render() {
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
name: "Action",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment