Skip to content

Commit

Permalink
Allow template property for optionChange
Browse files Browse the repository at this point in the history
  • Loading branch information
bookernath committed Feb 21, 2018
1 parent 643a8e4 commit 573aa1f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/api/product-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ export default class extends Base
* @param {Object} params
* @param callback
*/
optionChange(productId, params, callback) {
optionChange(productId, params, template = null, callback) {
if (typeof template === 'function') {
const temp = template;
callback = temp;
template = null;
}

const normalizedQs = normalizeQueryStringParams(params);
this.remoteRequest(this.endpoint + productId, 'POST', { params: normalizedQs }, (err, response) => {
this.remoteRequest(this.endpoint + productId, 'POST', { params: normalizedQs, template }, (err, response) => {
const emitData = {
err,
response,
Expand Down

0 comments on commit 573aa1f

Please sign in to comment.