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

hp active user approver

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