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 {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
......@@ -554,6 +555,16 @@ export default class SubHolding extends Component {
// console.log(this.state.dataTable)
// 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 {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -564,6 +575,7 @@ export default class SubHolding extends Component {
console.log(response);
let dataTable = []
if (response.data) {
if (response.data.status === 'success') {
let res = response.data.data
const handlePushChild = (item) => {
let indexIDzz = dataTable.findIndex((val) => val[1] === item.id)
......@@ -693,6 +705,16 @@ export default class SubHolding extends Component {
// console.log(this.state.dataTable)
// 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 {
this.setState({ dataTable: [], previewTable: false, loading: false, previewDownload: false })
}
......@@ -718,6 +740,7 @@ export default class SubHolding extends Component {
api.create().getReportPL(payloads).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === 'success') {
let dataTable = []
console.log(response)
let res = response.data.data
......@@ -885,6 +908,16 @@ export default class SubHolding extends Component {
console.log(this.state.dataTable)
// 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 {
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