Commit 8d8f0fa2 authored by faisalhamdi's avatar faisalhamdi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into faisal

parents b813942c 5b90dbfc
......@@ -312,7 +312,7 @@ export default class BudgetTahunan extends Component {
saveToMasterBudget(data) {
this.setState({ loading: true })
// console.log(JSON.stringify(data));
api.create().createSubmitReport(data).then(response => {
api.create('UPLOAD').createSubmitReport(data).then(response => {
console.log(response);
if (response.data) {
if (response.data.status === "success") {
......
This diff is collapsed.
......@@ -524,16 +524,17 @@ export default class UserRole extends Component {
}
uploadUser() {
console.log(JSON.stringify(this.state.payload))
api.create().uploadUser(this.state.payload).then(response => {
this.setState({buttonError: false})
console.log(response)
console.log(JSON.stringify(response))
if (response.data) {
if (response.ok) {
if (response.data.status === "success") {
this.getUser()
this.setState({ visibleUser: true, alert: true, messageAlert: response.data.message, tipeAlert: 'success', payload: [], rows: [], judul: '' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', payload: [], rows: [], judul: '' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -543,10 +544,10 @@ export default class UserRole extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', payload: [], rows: [], judul: '' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', payload: [], rows: [], judul: '' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
})
}
......
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