Use urlParam param instead of variable

In submit handlers for multi select filters, use the url param passed to
the function instead of the amenities url param variable.
This commit is contained in:
Hannu Lyytikainen 2018-02-15 14:34:46 +02:00
parent 743e7f072e
commit e18f6c07d5
2 changed files with 4 additions and 4 deletions

View file

@ -58,8 +58,8 @@ const SearchFiltersComponent = props => {
const handleSelectOptions = (urlParam, options) => {
const queryParams =
options && options.length > 0
? { ...urlQueryParams, [FEATURES_URL_PARAM]: options.join(',') }
: omit(urlQueryParams, FEATURES_URL_PARAM);
? { ...urlQueryParams, [urlParam]: options.join(',') }
: omit(urlQueryParams, urlParam);
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
};

View file

@ -90,8 +90,8 @@ class SearchFiltersMobileComponent extends Component {
const queryParams =
options && options.length > 0
? { ...urlQueryParams, [FEATURES_URL_PARAM]: options.join(',') }
: omit(urlQueryParams, FEATURES_URL_PARAM);
? { ...urlQueryParams, [urlParam]: options.join(',') }
: omit(urlQueryParams, urlParam);
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
}