Commit 7c8adec4 authored by Rifka Kurnia's avatar Rifka Kurnia

Merge branch 'rifka' into 'master'

hp user approver

See merge request !777
parents 1685d4fd a1c8d7d3
...@@ -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