refactored resource type and type mapping

This commit is contained in:
lotte
2019-06-24 16:29:54 +02:00
parent b846384ba7
commit f980b55c1c
101 changed files with 440 additions and 427 deletions

View File

@@ -20,7 +20,7 @@ import { DSpaceRESTv2Serializer } from '../dspace-rest-v2/dspace-rest-v2.seriali
import { catchError, filter, flatMap, map, take, tap } from 'rxjs/operators';
import { ErrorResponse, RestResponse } from '../cache/response.models';
import { StoreActionTypes } from '../../store.actions';
import { getNormalizedConstructorByType } from '../shared/resource-type.decorator';
import { getMapsToType } from '../cache/builders/build-decorators';
export const addToResponseCacheAndCompleteAction = (request: RestRequest, envConfig: GlobalConfig) =>
(source: Observable<RestResponse>): Observable<RequestCompleteAction> =>
@@ -45,7 +45,7 @@ export class RequestEffects {
flatMap((request: RestRequest) => {
let body;
if (isNotEmpty(request.body)) {
const serializer = new DSpaceRESTv2Serializer(getNormalizedConstructorByType(request.body.type));
const serializer = new DSpaceRESTv2Serializer(getMapsToType(request.body.type));
body = serializer.serialize(request.body);
}
return this.restApi.request(request.method, request.href, body, request.options).pipe(