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 4ed83ba
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 = callback;
callback = template;
template = temp;
}

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 4ed83ba

Please sign in to comment.