Commit 6bdb2085 authored by d.arizona's avatar d.arizona

approver issue

parent 2572c15b
......@@ -248,7 +248,7 @@ const create = (type = "") => {
const getRollingOutlookReport = (body) => api.post('transaction/rolling_outlook/get_all_report', body)
const getRollingOutlookLastUpdate = (body) => api.post('transaction/rolling_outlook/get_latest_update', body)
const getRollingOutlookRevision = (body) => api.post('transaction/rolling_outlook/get_revision', body)
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver')
const getRollingOutlookIsApprover = (body) => api.get('transaction/rolling_outlook/is_approver', body)
const uploadAttachmentRO = (body) => api.post('transaction/rolling_outlook/upload_attachment', body)
const deleteAttachmentRO = (id) => api.post(`transaction/rolling_outlook/delete_attachment/${id}`)
......
......@@ -124,6 +124,7 @@ export default class RollingOutlook extends Component {
}
checkApprover() {
// console.log('tot')
let listStatus1 = [
{ name: 'Open', value: 'not-yet' },
{ name: 'Submitted', value: 'approval_review' },
......@@ -138,6 +139,7 @@ export default class RollingOutlook extends Component {
]
api.create().getRollingOutlookIsApprover().then(response => {
// console.log('yuuuu')
console.log(response);
if (response.data.data.is_approver === true) {
this.setState({ isApprover: true, checkApprover: true, listStatus: listStatus1, selectedStatus: listStatus1 }, () =>
......@@ -533,15 +535,15 @@ export default class RollingOutlook extends Component {
console.log(this.state.lastStatus);
this.historyApproval()
this.getLatestPeriodSubmit()
api.create().checkApprover().then(response => {
// console.log(response);
if (response.data.data.is_approver === true) {
// api.create().checkApprover().then(response => {
// console.log(response);
if (this.state.isApprover) {
this.setState({ isApprover: true, checkApprover: true })
} else {
this.setState({ isApprover: this.state.lastStatus === "SUBMITTED" ? true : false, checkApprover: false })
}
})
// })
})
} else {
this.setState({ rollingOutlookID: null, loading: 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