HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -36,20 +36,16 @@ export default {
|
||||
},
|
||||
|
||||
async doAction() {
|
||||
//do the export and trigger download
|
||||
let vm = this;
|
||||
let url = `export/render/${vm.exportFormat}`;
|
||||
let body = this.dataListSelection;
|
||||
|
||||
try {
|
||||
//call api route
|
||||
let res = await window.$gz.api.upsert(url, body);
|
||||
const res = await window.$gz.api.upsert(
|
||||
`export/render/${this.exportFormat}`,
|
||||
this.dataListSelection
|
||||
);
|
||||
if (res.error) {
|
||||
//Error object constructor must be a string
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, vm));
|
||||
throw new Error(window.$gz.errorHandler.errorToString(res, this));
|
||||
}
|
||||
|
||||
let href = window.$gz.api.genericDownloadUrl(
|
||||
const href = window.$gz.api.genericDownloadUrl(
|
||||
"export/download/" + res.data
|
||||
);
|
||||
if (window.open(href, "DownloadExport") == null) {
|
||||
@@ -58,8 +54,8 @@ export default {
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
|
||||
window.$gz.errorHandler.handleFormError(error, this);
|
||||
window.$gz.eventBus.$emit("notify-error", this.$ay.t("JobFailed"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user