chore: make const out of export download file name (#2436)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/2436 Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de> Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
ca899d3b51
commit
878c6ea9e1
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
import AbstractService from './abstractService'
|
import AbstractService from './abstractService'
|
||||||
import {downloadBlob} from '../helpers/downloadBlob'
|
import {downloadBlob} from '../helpers/downloadBlob'
|
||||||
|
|
||||||
|
const DOWNLOAD_NAME = 'vikunja-export.zip'
|
||||||
|
|
||||||
export default class DataExportService extends AbstractService {
|
export default class DataExportService extends AbstractService {
|
||||||
request(password: string) {
|
request(password: string) {
|
||||||
return this.post('/user/export/request', {password})
|
return this.post('/user/export/request', {password})
|
||||||
|
@ -10,7 +12,7 @@ export default class DataExportService extends AbstractService {
|
||||||
const clear = this.setLoading()
|
const clear = this.setLoading()
|
||||||
try {
|
try {
|
||||||
const url = await this.getBlobUrl('/user/export/download', 'POST', {password})
|
const url = await this.getBlobUrl('/user/export/download', 'POST', {password})
|
||||||
downloadBlob(url, 'vikunja-export.zip')
|
downloadBlob(url, DOWNLOAD_NAME)
|
||||||
} finally {
|
} finally {
|
||||||
clear()
|
clear()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue