diff --git a/api/customers.js b/api/customers.js index bf52a7b..58a49ed 100644 --- a/api/customers.js +++ b/api/customers.js @@ -66,6 +66,13 @@ class CustomersApi extends Api { return r && r.body } + async updateCustomer (customer, opts) { + opts = opts || {} + const request = this.pick(customer, 'id', 'name', 'slug', 'description', 'version', 'customerCategory') + const r = await this.client.put(`/customers/${request.id}`, request, opts) + return r && r.body + } + async createExternalBatch (batch, opts) { opts = opts || {} const orgId = batch.orgId || opts.orgId || await this.client.getOrgId() diff --git a/api/products.js b/api/products.js index 6b13561..426a321 100644 --- a/api/products.js +++ b/api/products.js @@ -66,6 +66,13 @@ class ProductsApi extends Api { return r && r.body } + async updateProduct (product, opts) { + opts = opts || {} + const request = this.pick(product, 'id', 'name', 'slug', 'version', 'productCategory') + const r = await this.client.put(`/products/${request.id}`, request, opts) + return r && r.body + } + async createExternalBatch (batch, opts) { opts = opts || {} const orgId = batch.orgId || opts.orgId || await this.client.getOrgId()