From ddcece22d692d70106b073b68d1d231b995fe25d Mon Sep 17 00:00:00 2001 From: "stuart.woodman" Date: Wed, 28 Aug 2024 14:49:59 +1000 Subject: [PATCH] Changed IRIS blob downloads to include responses as well as blob so 204 (No Content) responses can be captured. --- .../src/lib/service/kml/download-iris.service.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/projects/portal-core-ui/src/lib/service/kml/download-iris.service.ts b/projects/portal-core-ui/src/lib/service/kml/download-iris.service.ts index 4374172..3626ea8 100644 --- a/projects/portal-core-ui/src/lib/service/kml/download-iris.service.ts +++ b/projects/portal-core-ui/src/lib/service/kml/download-iris.service.ts @@ -1,10 +1,8 @@ - import { throwError as observableThrowError, Observable } from 'rxjs'; import { Bbox } from '../../model/data/bbox.model'; import { LayerModel } from '../../model/data/layer.model'; import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable, Inject } from '@angular/core'; -import { min } from 'rxjs/operators'; /** * Service to download IRIS data @@ -51,9 +49,9 @@ export class DownloadIrisService { httpParams = httpParams.append('serviceUrls', url); return this.http.post(this.env.portalBaseUrl + 'downloadDataAsZip.do', httpParams, { headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'), - responseType: 'blob' + responseType: 'blob', + observe: 'response' }); - } catch (e) { console.error("Download error:", e); return observableThrowError(e); @@ -103,9 +101,9 @@ export class DownloadIrisService { return this.http.post(this.env.portalBaseUrl + 'downloadDataAsZip.do', httpParams, { headers: new HttpHeaders().set('Content-Type', 'application/x-www-form-urlencoded'), - responseType: 'blob' + responseType: 'blob', + observe: 'response' }); - } catch (e) { console.error("Download error:", e); return observableThrowError(e);