15407: Restricts mapKeys' recursion to only "items" keys, to support listing.
[arvados-workbench2.git] / src / services / common-service / common-service.ts
index b301a727551135ef4d6bff23f11d90446b13b57b..212f2f4d0305fbf36a54bce6393a16506ff2d005 100644 (file)
@@ -23,6 +23,7 @@ export interface ListArguments {
 }
 
 export interface ListResults<T> {
+    clusterId?: string;
     kind: string;
     offset: number;
     limit: number;
@@ -53,7 +54,7 @@ export class CommonService<T> {
                         .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));
@@ -128,4 +129,4 @@ export class CommonService<T> {
             this.actions
         );
     }
-}
\ No newline at end of file
+}