Commit 14822e98 authored by muhammad ridwan's avatar muhammad ridwan

Merge branch 'env/ridwan' into 'ENV-DEV-CR-CAFRM'

fixed file download

See merge request !1616
parents 2b8f1d48 2dbe9a51
......@@ -193,10 +193,10 @@ class RepotrCafrm extends Component {
}
async downloadData() {
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monitoring/export_cafrm_report?periode=${this.state.curYear}&months=${this.state.curMonth}`
let url = `${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monitoring/export_cafrm_report?periode=${this.state.curYear}&months=${this.state.curMonth}&status=${this.state.curStatus}`
console.log(url);
let res = await fetch(
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monitoring/export_cafrm_report?periode=${this.state.curYear}&months=${this.state.curMonth}`
`${process.env.REACT_APP_URL_MAIN_BE}/public/transaction/monitoring/export_cafrm_report?periode=${this.state.curYear}&months=${this.state.curMonth}&status=${this.state.curStatus}`
)
res = await res.blob()
this.setState({ loading: false })
......@@ -204,7 +204,7 @@ class RepotrCafrm extends Component {
let url = window.URL.createObjectURL(res);
let a = document.createElement('a');
a.href = url;
a.download = `Progress Report CARFM ${this.state.curYear}-${this.state.curMonth}.xlsx`;
a.download = `Progress Report CARFM ${this.state.curYear}-${this.state.curMonth}-${this.state.defaultStatus.name}.xlsx`;
a.click();
}
}
......
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