osl-base-extended 14.8.1 → 14.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -635,7 +635,7 @@ class Httpbase {
635
635
  return this.handleError(error);
636
636
  }
637
637
  }
638
- async download(methodName, fileName, params) {
638
+ async download(methodName, fileName, params, isDownload = true) {
639
639
  try {
640
640
  const res = await firstValueFrom(this.http
641
641
  .get(this.getEndPoint(methodName), {
@@ -645,14 +645,16 @@ class Httpbase {
645
645
  responseType: 'blob',
646
646
  })
647
647
  .pipe(timeout(60000)));
648
- const blob = res.body;
649
- const url = URL.createObjectURL(blob);
650
- const anchor = document.createElement('a');
651
- anchor.href = url;
652
- anchor.download = fileName;
653
- anchor.click();
654
- URL.revokeObjectURL(url);
655
- return this.handleSuccess(res.status, null, res.headers);
648
+ if (isDownload) {
649
+ const blob = res.body;
650
+ const url = URL.createObjectURL(blob);
651
+ const anchor = document.createElement('a');
652
+ anchor.href = url;
653
+ anchor.download = fileName;
654
+ anchor.click();
655
+ URL.revokeObjectURL(url);
656
+ }
657
+ return this.handleSuccess(res.status, res.body, res.headers);
656
658
  }
657
659
  catch (error) {
658
660
  // responseType:'blob' causes Angular to wrap the error body as a Blob too,