mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Rename features url param const
This commit is contained in:
parent
5c073d75ba
commit
8bf94da03e
1 changed files with 6 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ import { createResourceLocatorString } from '../../util/routes';
|
|||
import css from './SearchFilters.css';
|
||||
|
||||
const CATEGORY_URL_PARAM = 'pub_category';
|
||||
const AMENITIES_URL_PARAM = 'pub_amenities';
|
||||
const FEATURES_URL_PARAM = 'pub_amenities';
|
||||
|
||||
// Dropdown container can have a positional offset (in pixels)
|
||||
const FILTER_DROPDOWN_OFFSET = -14;
|
||||
|
|
@ -49,8 +49,8 @@ const SearchFiltersComponent = props => {
|
|||
id: 'SearchFilters.featuresLabel',
|
||||
});
|
||||
|
||||
const initialFeatures = !!urlQueryParams[AMENITIES_URL_PARAM]
|
||||
? urlQueryParams[AMENITIES_URL_PARAM].split(',')
|
||||
const initialFeatures = !!urlQueryParams[FEATURES_URL_PARAM]
|
||||
? urlQueryParams[FEATURES_URL_PARAM].split(',')
|
||||
: [];
|
||||
|
||||
const initialCategory = urlQueryParams[CATEGORY_URL_PARAM];
|
||||
|
|
@ -58,8 +58,8 @@ const SearchFiltersComponent = props => {
|
|||
const handleSelectOptions = (urlParam, options) => {
|
||||
const queryParams =
|
||||
options && options.length > 0
|
||||
? { ...urlQueryParams, [AMENITIES_URL_PARAM]: options.join(',') }
|
||||
: omit(urlQueryParams, AMENITIES_URL_PARAM);
|
||||
? { ...urlQueryParams, [FEATURES_URL_PARAM]: options.join(',') }
|
||||
: omit(urlQueryParams, FEATURES_URL_PARAM);
|
||||
|
||||
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
|
||||
};
|
||||
|
|
@ -88,7 +88,7 @@ const SearchFiltersComponent = props => {
|
|||
const featuresFilter = features ? (
|
||||
<SelectMultipleFilter
|
||||
name="amenities"
|
||||
urlParam={AMENITIES_URL_PARAM}
|
||||
urlParam={FEATURES_URL_PARAM}
|
||||
label={featuresLabel}
|
||||
onSelect={handleSelectOptions}
|
||||
options={features}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue