Applied feedback and other fixes

This commit is contained in:
Lotte Hofstede
2018-04-13 15:18:35 +02:00
parent c9e7cdcf9a
commit e56ea2aff8
20 changed files with 107 additions and 83 deletions

View File

@@ -117,8 +117,9 @@ export abstract class BaseResponseParsingService {
this.objectCache.add(co, this.EnvConfig.cache.msToLive, requestHref);
}
processPageInfo(pageObj: any): PageInfo {
if (isNotEmpty(pageObj)) {
processPageInfo(payload: any): PageInfo {
if (isNotEmpty(payload.page)) {
const pageObj = Object.assign({}, payload.page, {_links: payload._links});
const pageInfoObject = new DSpaceRESTv2Serializer(PageInfo).deserialize(pageObj);
if (pageInfoObject.currentPage >= 0) {
Object.assign(pageInfoObject, { currentPage: pageInfoObject.currentPage + 1 });