Commit 337e7878 authored by r.kurnia's avatar r.kurnia

hp active user approver

parent 21dc0650
......@@ -108,15 +108,16 @@ class HomePage extends Component {
getApprMat() {
this.setState({loading: true})
api.create().getAM().then((response) => {
// console.log(response);
console.log(response);
let actAMActive = []
let actAM = response.data.data.map((item, index) => {
if (String(item.status).toLocaleLowerCase() == 'active') {
actAMActive.push(item)
return item
}
})
let userId = localStorage.getItem(Constant.USER)
let indexId = actAM.findIndex((val) => val.user_id == userId)
let indexId = actAMActive.findIndex((val) => val.user_id == userId)
if (indexId === -1) {
this.setState({ isApprover: false })
this.getListUserSubco()
......
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