Merge branch 'master' into 13703-data-explorer-and-contents-api
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 4 Jul 2018 11:38:22 +0000 (13:38 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 4 Jul 2018 11:38:22 +0000 (13:38 +0200)
refs #13703

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

1  2 
src/common/api/common-resource-service.ts

index 6c8c397f3b34c5546a8eac7a9b91b0f736638665,3e147b224772257b75967d33e4ccf9286037399a..58bcaa5ff3c70bac428f61ae93db9f6dc60debd7
@@@ -20,8 -20,8 +20,8 @@@ export interface Resource 
  }
  
  export interface ListArguments {
-     limit: number;
-     offset: number;
+     limit?: number;
+     offset?: number;
      filters?: FilterBuilder;
      order?: OrderBuilder;
      select?: string[];
@@@ -68,8 -68,10 +68,10 @@@ export default class CommonResourceServ
          this.resourceType = '/' + resourceType + '/';
      }
  
-     create() {
-         throw new Error("Not implemented");
+     create(data: Partial<T>) {
+         return this.serverApi
+             .post<T>(this.resourceType, data)
+             .then(CommonResourceService.mapResponseKeys);
      }
  
      delete(uuid: string): Promise<T> {
              .then(CommonResourceService.mapResponseKeys);
      }
  
-     list(args: ListArguments): Promise<ListResults<T>> {
+     list(args: ListArguments = {}): Promise<ListResults<T>> {
          const { filters, order, ...other } = args;
          const params = {
              ...other,
              filters: filters ? filters.get() : undefined,
 -            order: order ? order.get() : undefined
 +            order: order ? order.getOrder() : undefined
          };
          return this.serverApi
              .get(this.resourceType, {