Commit 44ffebe4 authored by rifkaki's avatar rifkaki

conflict index

parents 7bfd5e81 a4df4555
......@@ -693,6 +693,7 @@ const create = (type = "") => {
getAllMasterDataCat,
getParentItemReport,
saveMasterDataCat,
// getDetailMasterDataCat,
deleteMasterDataCat
}
}
......
......@@ -781,32 +781,32 @@ export default class MasterDataCAT extends Component {
}
}
updateReportItems = (payload) => {
this.setState({ edit: false })
api.create().updateReportItems(payload).then(response => {
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
this.getData()
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
// updateReportItems = (payload) => {
// this.setState({ edit: false })
// api.create().updateReportItems(payload).then(response => {
// if (response.data) {
// if (response.ok) {
// if (response.data.status == 'success') {
// this.getData()
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
// if (response.data.message.includes("Someone Logged In")) {
// setTimeout(() => {
// localStorage.removeItem(Constant.TOKEN)
// window.location.reload();
// }, 1000);
// }
// })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
// }
// } else {
// this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
// }
// })
// }
uploadReportItems() {
api.create().uploadReportItems(this.state.payload).then(response => {
......@@ -1175,7 +1175,7 @@ export default class MasterDataCAT extends Component {
onClickClose={() => this.setState({ edit: false })}
data={this.state.rowData}
refresh={this.getData.bind(this)}
updateReportItems={this.updateReportItems.bind(this)}
updateReportItems={this.createReportItems.bind(this)}
/>
)}
{this.state.popupError && (
......
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