From 7f74ad88e43398fab60a8245cc961f85d7032f7f Mon Sep 17 00:00:00 2001 From: Afonso Caldas Date: Thu, 11 Oct 2018 15:06:28 +0100 Subject: [PATCH] fixed _getConfigOptions --- src/js/base/api.js | 2 +- src/js/ripe-min.js | 2 +- src/js/ripe.js | 2 +- src/python/ripe_demo/static/js/ripe.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/base/api.js b/src/js/base/api.js index 7eeee0f90..4efcd7d25 100644 --- a/src/js/base/api.js +++ b/src/js/base/api.js @@ -266,7 +266,7 @@ ripe.Ripe.prototype._getConfigOptions = function(options) { return Object.assign(options, { url: url, method: "GET", - params: {} + params: params }); }; diff --git a/src/js/ripe-min.js b/src/js/ripe-min.js index 9d02ffd39..d261e35c5 100644 --- a/src/js/ripe-min.js +++ b/src/js/ripe-min.js @@ -59,7 +59,7 @@ if(!color){continue;} params.p.push(part+":"+material+":"+color);} return options;};ripe.Ripe.prototype._getQuery=function(options){options=this._getQueryOptions(options);return this._buildQuery(options.params);};ripe.Ripe.prototype._getConfigOptions=function(options){options=options||{};var brand=options.brand===undefined?this.brand:options.brand;var model=options.model===undefined?this.model:options.model;var country=options.country===undefined?this.country:options.country;var url=this.url+"brands/"+brand+"/models/"+model+"/config";var params={};if(country){params.country=country;} if(options.filter!==undefined){params.filter=options.filter;} -return Object.assign(options,{url:url,method:"GET",params:{}});};ripe.Ripe.prototype._getPriceOptions=function(options){options=options||{};var url=this.url+"config/price";options=this._getQueryOptions(options);return Object.assign(options,{url:url,method:"GET"});};ripe.Ripe.prototype._getDefaultsOptions=function(options){options=options||{};var brand=options.brand===undefined?this.brand:options.brand;var model=options.model===undefined?this.model:options.model;var url=this.url+"brands/"+brand+"/models/"+model+"/defaults";return Object.assign(options,{url:url,method:"GET"});};ripe.Ripe.prototype._getCombinationsOptions=function(options){options=options||{};var brand=options.brand===undefined?this.brand:options.brand;var model=options.model===undefined?this.model:options.model;var url=this.url+"brands/"+brand+"/models/"+model+"/combinations";var params={};if(options.resolve!==undefined){params.resolve=options.resolve;} +return Object.assign(options,{url:url,method:"GET",params:params});};ripe.Ripe.prototype._getPriceOptions=function(options){options=options||{};var url=this.url+"config/price";options=this._getQueryOptions(options);return Object.assign(options,{url:url,method:"GET"});};ripe.Ripe.prototype._getDefaultsOptions=function(options){options=options||{};var brand=options.brand===undefined?this.brand:options.brand;var model=options.model===undefined?this.model:options.model;var url=this.url+"brands/"+brand+"/models/"+model+"/defaults";return Object.assign(options,{url:url,method:"GET"});};ripe.Ripe.prototype._getCombinationsOptions=function(options){options=options||{};var brand=options.brand===undefined?this.brand:options.brand;var model=options.model===undefined?this.model:options.model;var url=this.url+"brands/"+brand+"/models/"+model+"/combinations";var params={};if(options.resolve!==undefined){params.resolve=options.resolve;} if(options.sort!==undefined){params.sort=options.sort;} if(options.use_name!==undefined){params.use_name=options.use_name;} return Object.assign(options,{url:url,method:"GET",params:params});};ripe.Ripe.prototype._getImageOptions=function(options){options=options||{};options.country=options.country||null;options.currency=options.currency||null;options=this._getQueryOptions(options);var params=options.params||{};options.params=params;if(options.format!==undefined){params.format=options.format;} diff --git a/src/js/ripe.js b/src/js/ripe.js index 8354df66d..1bf364043 100644 --- a/src/js/ripe.js +++ b/src/js/ripe.js @@ -1033,7 +1033,7 @@ ripe.Ripe.prototype._getConfigOptions = function(options) { return Object.assign(options, { url: url, method: "GET", - params: {} + params: params }); }; diff --git a/src/python/ripe_demo/static/js/ripe.js b/src/python/ripe_demo/static/js/ripe.js index 8354df66d..1bf364043 100644 --- a/src/python/ripe_demo/static/js/ripe.js +++ b/src/python/ripe_demo/static/js/ripe.js @@ -1033,7 +1033,7 @@ ripe.Ripe.prototype._getConfigOptions = function(options) { return Object.assign(options, { url: url, method: "GET", - params: {} + params: params }); };