RED-5427: catch 404 from file attributes
This commit is contained in:
parent
b7f8327990
commit
e2e8bba9e1
@ -1,8 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { GenericService, HeadersConfiguration, RequiredParam, Validate } from '@iqser/common-ui';
|
||||
import { IPlaceholdersResponse, IReportTemplate } from '@red/domain';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { HttpResponse } from '@angular/common/http';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@ -43,7 +44,7 @@ export class ReportTemplateService extends GenericService<unknown> {
|
||||
|
||||
@Validate()
|
||||
getTemplatesByPlaceholder(@RequiredParam() dossierTemplateId: string, @RequiredParam() attributeId: string) {
|
||||
return this._post<IReportTemplate[]>({ value: attributeId }, `templates/${dossierTemplateId}`);
|
||||
return this._post<IReportTemplate[]>({ value: attributeId }, `templates/${dossierTemplateId}`).pipe(catchError(() => of([])));
|
||||
}
|
||||
|
||||
downloadReportTemplate(dossierTemplateId: string, templateId: string, observe: 'response'): Observable<HttpResponse<Blob>>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user