Commit 92380485 authored by Faisal Hamdi's avatar Faisal Hamdi

Merge branch 'faisal' into 'master'

#issue login

See merge request !1197
parents dc06a583 50dbff9a
...@@ -424,6 +424,7 @@ export default class SubHolding extends Component { ...@@ -424,6 +424,7 @@ export default class SubHolding extends Component {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
...@@ -554,6 +555,16 @@ export default class SubHolding extends Component { ...@@ -554,6 +555,16 @@ export default class SubHolding extends Component {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
// this.getPLDetailMR(payload) // this.getPLDetailMR(payload)
// }) // })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
...@@ -564,6 +575,7 @@ export default class SubHolding extends Component { ...@@ -564,6 +575,7 @@ export default class SubHolding extends Component {
console.log(response); console.log(response);
let dataTable = [] let dataTable = []
if (response.data) { if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data let res = response.data.data
const handlePushChild = (item) => { const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id) let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
...@@ -693,6 +705,16 @@ export default class SubHolding extends Component { ...@@ -693,6 +705,16 @@ export default class SubHolding extends Component {
// console.log(this.state.dataTable) // console.log(this.state.dataTable)
// this.getBalanceSheetMR(payload) // this.getBalanceSheetMR(payload)
// }) // })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
...@@ -718,6 +740,7 @@ export default class SubHolding extends Component { ...@@ -718,6 +740,7 @@ export default class SubHolding extends Component {
api.create().getReportPL(payloads).then(response => { api.create().getReportPL(payloads).then(response => {
console.log(response); console.log(response);
if (response.data) { if (response.data) {
if (response.data.status === 'success') {
let dataTable = [] let dataTable = []
console.log(response) console.log(response)
let res = response.data.data let res = response.data.data
...@@ -885,6 +908,16 @@ export default class SubHolding extends Component { ...@@ -885,6 +908,16 @@ export default class SubHolding extends Component {
console.log(this.state.dataTable) console.log(this.state.dataTable)
// this.getReportPLMR(payload) // this.getReportPLMR(payload)
// }) // })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else { } else {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false }) this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
} }
......
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