diff --git a/apps/red-ui/src/app/services/report-template.service.ts b/apps/red-ui/src/app/services/report-template.service.ts index 945659a34..e58247d34 100644 --- a/apps/red-ui/src/app/services/report-template.service.ts +++ b/apps/red-ui/src/app/services/report-template.service.ts @@ -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 { @Validate() getTemplatesByPlaceholder(@RequiredParam() dossierTemplateId: string, @RequiredParam() attributeId: string) { - return this._post({ value: attributeId }, `templates/${dossierTemplateId}`); + return this._post({ value: attributeId }, `templates/${dossierTemplateId}`).pipe(catchError(() => of([]))); } downloadReportTemplate(dossierTemplateId: string, templateId: string, observe: 'response'): Observable>;