[ARVADOS-WORKBENCH2] updated: 1.2.0-533-g2649f07

Git user git at public.curoverse.com
Fri Oct 5 02:20:35 EDT 2018


Summary of changes:
 .../collection-service/collection-service.ts       | 26 ++++++++++------------
 src/services/groups-service/groups-service.ts      | 10 ++++-----
 2 files changed, 16 insertions(+), 20 deletions(-)

       via  2649f07eff4630077840bab8af20fb3ea554f0e1 (commit)
      from  3badd0539b3ba8e20db4c1243a02ce8dc6eb56a9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 2649f07eff4630077840bab8af20fb3ea554f0e1
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Fri Oct 5 08:20:25 2018 +0200

    change params for snakeCase, clean code
    
    Feature #14278
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/services/collection-service/collection-service.ts b/src/services/collection-service/collection-service.ts
index 4072901..138f16a 100644
--- a/src/services/collection-service/collection-service.ts
+++ b/src/services/collection-service/collection-service.ts
@@ -71,21 +71,19 @@ export class CollectionService extends TrashableResourceService<CollectionResour
     }
 
     update(uuid: string, data: Partial<CollectionResource>) {
-        if (uuid && data) {
+        if (uuid && data && data.properties) {
             const { properties } = data;
-            if (properties) {
-                const mappedData = {
-                    ...TrashableResourceService.mapKeys(snakeCase)(data),
-                    properties,
-                };
-                return TrashableResourceService
-                    .defaultResponse(
-                        this.serverApi
-                            .put<CollectionResource>(this.resourceType + uuid, mappedData),
-                        this.actions,
-                        false
-                    );
-            }
+            const mappedData = {
+                ...TrashableResourceService.mapKeys(snakeCase)(data),
+                properties,
+            };
+            return TrashableResourceService
+                .defaultResponse(
+                    this.serverApi
+                        .put<CollectionResource>(this.resourceType + uuid, mappedData),
+                    this.actions,
+                    false
+                );
         }
         return TrashableResourceService
             .defaultResponse(
diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts
index bf92836..92af051 100644
--- a/src/services/groups-service/groups-service.ts
+++ b/src/services/groups-service/groups-service.ts
@@ -48,21 +48,19 @@ export class GroupsService<T extends GroupResource = GroupResource> extends Tras
         const response = await CommonResourceService.defaultResponse(
             this.serverApi
                 .get(this.resourceType + `${uuid}/contents`, {
-                    params: CommonResourceService.mapKeys(_.camelCase)(params)
+                    params: CommonResourceService.mapKeys(_.snakeCase)(params)
                 }),
             this.actions, 
             false
         );
         const { items, ...res } = response;
         const mappedItems = items.map((item: any) => {
+            const mappedItem = TrashableResourceService.mapKeys(_.camelCase)(item);
             if (item.kind === ResourceKind.COLLECTION) {
                 const { properties } = item;
-                return {
-                    ...TrashableResourceService.mapKeys(_.camelCase)(item),
-                    properties,
-                };
+                return { ...mappedItem, properties };
             } else {
-                return TrashableResourceService.mapKeys(_.camelCase)(item);
+                return mappedItem;
             }
         });
         const mappedResponse = { ...TrashableResourceService.mapKeys(_.camelCase)(res) };

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list