From c5cdcf6f1a88ab8b29b9f028f5ab4dfaf34a6784 Mon Sep 17 00:00:00 2001 From: Tomasz Sikora Date: Wed, 30 Nov 2016 17:56:56 +0100 Subject: [PATCH] renames --- src/Products.js | 10 +++++----- src/Redemptions.js | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Products.js b/src/Products.js index ab1a88e..b2ce06f 100644 --- a/src/Products.js +++ b/src/Products.js @@ -23,12 +23,12 @@ module.exports = class Products { return this.client.delete(`/products/${encode(productId)}`, callback) } - list (query, callback) { - if (isFunction(query)) { - callback = query - query = {} + list (params, callback) { + if (isFunction(params)) { + callback = params + params = {} } - return this.client.get('/products', query, callback) + return this.client.get('/products', params, callback) } createSku (productId, sku, callback) { diff --git a/src/Redemptions.js b/src/Redemptions.js index 034a1e9..92b5ae9 100644 --- a/src/Redemptions.js +++ b/src/Redemptions.js @@ -36,32 +36,32 @@ module.exports = class Redemptions { return this.client.post(`/vouchers/${encode(code)}/redemption`, context, callback, {qs}) } - list (query, callback) { - if (isFunction(query)) { - callback = query - query = null + list (params, callback) { + if (isFunction(params)) { + callback = params + params = {} } - return this.client.get('/redemptions', query, callback) + return this.client.get('/redemptions', params, callback) } getForVoucher (code, callback) { return this.client.get(`/vouchers/${encode(code)}/redemption`, null, callback) } - rollback (redemptionId, data, callback) { - if (isFunction(data)) { - callback = data - data = null + rollback (redemptionId, params, callback) { + if (isFunction(params)) { + callback = params + params = null } let qs = {} let payload = {} - if (isString(data)) { - qs.reason = encode(data) - } else if (isObject(data)) { - const {reason, tracking_id, customer} = data + if (isString(params)) { + qs.reason = encode(params) + } else if (isObject(params)) { + const {reason, tracking_id, customer} = params qs = { reason: reason ? encode(reason) : undefined,