15407: Restricts mapKeys' recursion to only "items" keys, to support listing.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 16 Aug 2019 14:24:45 +0000 (11:24 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Mon, 19 Aug 2019 19:43:20 +0000 (16:43 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

src/services/common-service/common-service.ts

index 07ff398a4abdd7d4409bb67dd660e02f304af359..212f2f4d0305fbf36a54bce6393a16506ff2d005 100644 (file)
@@ -54,7 +54,7 @@ export class CommonService<T> {
                         .map(key => [key, mapFn(key)])
                         .reduce((newValue, [key, newKey]) => ({
                             ...newValue,
                         .map(key => [key, mapFn(key)])
                         .reduce((newValue, [key, newKey]) => ({
                             ...newValue,
-                            [newKey]: CommonService.mapKeys(mapFn)(value[key])
+                            [newKey]: (key === 'items') ? CommonService.mapKeys(mapFn)(value[key]) : value[key]
                         }), {});
                 case _.isArray(value):
                     return value.map(CommonService.mapKeys(mapFn));
                         }), {});
                 case _.isArray(value):
                     return value.map(CommonService.mapKeys(mapFn));