feat: use async / await where it makes sense
This commit is contained in:
@ -6,10 +6,13 @@ export default class DataExportService extends AbstractService {
|
||||
return this.post('/user/export/request', {password: password})
|
||||
}
|
||||
|
||||
download(password) {
|
||||
async download(password) {
|
||||
const clear = this.setLoading()
|
||||
return this.getBlobUrl('/user/export/download', 'POST', {password})
|
||||
.then(url => downloadBlob(url, 'vikunja-export.zip'))
|
||||
.finally(() => clear())
|
||||
try {
|
||||
const url = await this.getBlobUrl('/user/export/download', 'POST', {password})
|
||||
downloadBlob(url, 'vikunja-export.zip')
|
||||
} finally {
|
||||
clear()
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user