Commit 79bfb438 authored by faisalhamdi's avatar faisalhamdi

editMasterDataCat

parent cc3294c7
......@@ -189,6 +189,7 @@ const create = (type = "") => {
const getAllMasterDataCat = () => api.get('item_report_company/get_all_item_report_company')
const getParentItemReport = (body) => api.post('item_report/get_parent_item_report_default', body)
const saveMasterDataCat = (body) => api.post('item_report_company/create_item_report_company', body)
// const getDetailMasterDataCat = (id) => api.get(`item_report_company/create_item_report_company/${id}`)
//Transaction
const getReportTypeBody = (body) => api.post('transaction/master_budget/get_all_report', body)
......@@ -691,7 +692,8 @@ const create = (type = "") => {
getRollingOutlookBS,
getAllMasterDataCat,
getParentItemReport,
saveMasterDataCat
saveMasterDataCat,
// getDetailMasterDataCat
}
}
......
......@@ -775,32 +775,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 => {
......@@ -1163,7 +1163,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