chore: make const out of export download file name #2436

Merged
konrad merged 1 commits from dpschen/frontend:feature/chore-use-const-for-download-file-name into main 2022-09-28 13:28:45 +00:00
1 changed files with 3 additions and 1 deletions

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) {
return this.post('/user/export/request', {password: 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()
}