18966: Changes back collectionService.get() to use the GET HTTP method.
[arvados-workbench2.git] / src / services / common-service / common-service.ts
index ddaf2ab02fa5ee4e18d544158e42f7606339983c..f16a2024ad2c3a1775d4a5fb7e83f784e08554e4 100644 (file)
@@ -117,7 +117,13 @@ export class CommonService<T> {
     get(uuid: string, showErrors?: boolean, select?: string[], session?: Session) {
         this.validateUuid(uuid);
 
-        const cfg: AxiosRequestConfig = {};
+        const cfg: AxiosRequestConfig = {
+            params: {
+                select: select
+                    ? `[${select.map(snakeCase).map(s => `"${s}"`).join(',')}]`
+                    : undefined
+            }
+        };
         if (session) {
             cfg.baseURL = session.baseUrl;
             cfg.headers = { 'Authorization': 'Bearer ' + session.token };
@@ -125,7 +131,7 @@ export class CommonService<T> {
 
         return CommonService.defaultResponse(
             this.serverApi
-                .get<T>(`/${this.resourceType}/${uuid}`, session ? cfg : undefined),
+                .get<T>(`/${this.resourceType}/${uuid}`, cfg),
             this.actions,
             true, // mapKeys
             showErrors