Commit 6753ee3c authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

hp

parent a90df87e
...@@ -34,8 +34,6 @@ export default class getAllDocument extends Component { ...@@ -34,8 +34,6 @@ export default class getAllDocument extends Component {
componentDidMount() { componentDidMount() {
this.getData() this.getData()
console.log(this.props.allsubcoEdit)
console.log(this.props.btnedit)
} }
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
......
...@@ -21,7 +21,8 @@ class HomePage extends Component { ...@@ -21,7 +21,8 @@ class HomePage extends Component {
{ nama: 'Puninar Infinite Raya', status: 'complete' }, { nama: 'Puninar Infinite Raya', status: 'complete' },
{ nama: 'Dharma Group', status: 'overdue' }, { nama: 'Dharma Group', status: 'overdue' },
{ nama: 'Daya Group', status: 'open' }, { nama: 'Daya Group', status: 'open' },
] ],
isApprover: true
} }
} }
...@@ -36,15 +37,16 @@ class HomePage extends Component { ...@@ -36,15 +37,16 @@ class HomePage extends Component {
} }
} }
}) })
api.create().checkApprover().then(response => { // api.create().checkApprover().then(response => {
console.log(response); // console.log(response);
if (response.data.data.is_approver === true) { // if (response.data.data.is_approver === true) {
this.setState({ isApprover: true }, () => // this.setState({ isApprover: true }, () =>
this.getDashboard()) // this.getDashboard())
} else { // } else {
this.setState({ isApprover: false }) // this.setState({ isApprover: false })
} // }
}) // })
this.getApprMat()
} }
componentDidUpdate() { componentDidUpdate() {
...@@ -68,6 +70,24 @@ class HomePage extends Component { ...@@ -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() { render() {
const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", { const columns = ["#", "ID", "Nama Perusahaan", "Jenis Report", "Revisi", "Status", {
name: "Action", 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