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:
Dominik Pschenitschni 2022-09-28 13:28:45 +00:00 committed by konrad
parent ca899d3b51
commit 878c6ea9e1

View file

@ -1,6 +1,8 @@
import AbstractService from './abstractService'
import {downloadBlob} from '../helpers/downloadBlob'
const DOWNLOAD_NAME = 'vikunja-export.zip'
export default class DataExportService extends AbstractService {
request(password: string) {
return this.post('/user/export/request', {password})
@ -10,7 +12,7 @@ export default class DataExportService extends AbstractService {
const clear = this.setLoading()
try {
const url = await this.getBlobUrl('/user/export/download', 'POST', {password})
downloadBlob(url, 'vikunja-export.zip')
downloadBlob(url, DOWNLOAD_NAME)
} finally {
clear()
}