diff --git a/alfa-client/libs/admin/reporting-shared/src/lib/aggregation-mapping-list-resource.service.ts b/alfa-client/libs/admin/reporting-shared/src/lib/aggregation-mapping-list-resource.service.ts index ab781c8a7689b110648eda5cccda1e6cee46a801..0520cc060c4c8aa1782a9ba1e1b5835d1a907cef 100644 --- a/alfa-client/libs/admin/reporting-shared/src/lib/aggregation-mapping-list-resource.service.ts +++ b/alfa-client/libs/admin/reporting-shared/src/lib/aggregation-mapping-list-resource.service.ts @@ -1,14 +1,9 @@ import { ConfigurationLinkRel, ConfigurationResource, ConfigurationService } from '@admin-client/configuration-shared'; -import { - ApiListResourceService, - ListResourceServiceConfig, - ResourceListService, - ResourceRepository, -} from '@alfa-client/tech-shared'; +import { ApiListResourceService, ListResourceServiceConfig, ResourceRepository } from '@alfa-client/tech-shared'; import { AggregationMappingListLinkRel } from './aggregation-mapping.linkrel'; import { AggregationMappingListResource, AggregationMappingResource } from './aggregation-mapping.model'; -export class AggregationMappingListResourceService extends ResourceListService< +export class AggregationMappingListResourceService extends ApiListResourceService< ConfigurationResource, AggregationMappingListResource, AggregationMappingResource diff --git a/alfa-client/libs/tech-shared/src/lib/resource/api-resource.service.ts b/alfa-client/libs/tech-shared/src/lib/resource/api-resource.service.ts index d7e4c3083917e1f045b83bca4efc7d6e36245812..bb0eed1b7e95cd597bb6dd2ca79755d3fd3a8f23 100644 --- a/alfa-client/libs/tech-shared/src/lib/resource/api-resource.service.ts +++ b/alfa-client/libs/tech-shared/src/lib/resource/api-resource.service.ts @@ -41,7 +41,7 @@ export class ApiResourceService<B extends Resource, T extends Resource> extends super(config, stateService); } - public save(toSave: unknown): Observable<StateResource<T | HttpError>> { + public save(toSave: unknown): Observable<StateResource<T>> { return this.selectResource().pipe( switchMap((stateResource: StateResource<T>) => this.doSave(stateResource.resource, toSave).pipe( @@ -50,7 +50,7 @@ export class ApiResourceService<B extends Resource, T extends Resource> extends catchError((errorResponse: HttpErrorResponse) => this.handleError(errorResponse)), ), ), - startWith(createEmptyStateResource<T | HttpError>(true)), + startWith(createEmptyStateResource<T>(true)), ); } @@ -62,7 +62,7 @@ export class ApiResourceService<B extends Resource, T extends Resource> extends }); } - public patch(toPatch: unknown): Observable<StateResource<T | HttpError>> { + public patch(toPatch: unknown): Observable<StateResource<T>> { return this.selectResource().pipe( switchMap((stateResource: StateResource<T>) => this.doPatch(stateResource.resource, toPatch).pipe( @@ -71,7 +71,7 @@ export class ApiResourceService<B extends Resource, T extends Resource> extends catchError((errorResponse: HttpErrorResponse) => this.handleError(errorResponse)), ), ), - startWith(createEmptyStateResource<T | HttpError>(true)), + startWith(createEmptyStateResource<T>(true)), ); } @@ -83,7 +83,7 @@ export class ApiResourceService<B extends Resource, T extends Resource> extends }); } - handleError(errorResponse: HttpErrorResponse): Observable<StateResource<HttpError>> { + handleError(errorResponse: HttpErrorResponse): Observable<StateResource<T>> { if (isUnprocessableEntity(errorResponse.status)) { return of(createErrorStateResource((<any>errorResponse) as HttpError)); }