mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Rename amenities url param variable
This commit is contained in:
parent
e18f6c07d5
commit
059aa69a6d
2 changed files with 10 additions and 10 deletions
|
|
@ -12,7 +12,7 @@ import { createResourceLocatorString } from '../../util/routes';
|
|||
import css from './SearchFilters.css';
|
||||
|
||||
const CATEGORY_URL_PARAM = 'pub_category';
|
||||
const FEATURES_URL_PARAM = 'pub_amenities';
|
||||
const AMENITIES_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[FEATURES_URL_PARAM]
|
||||
? urlQueryParams[FEATURES_URL_PARAM].split(',')
|
||||
const initialFeatures = !!urlQueryParams[AMENITIES_URL_PARAM]
|
||||
? urlQueryParams[AMENITIES_URL_PARAM].split(',')
|
||||
: [];
|
||||
|
||||
const initialCategory = urlQueryParams[CATEGORY_URL_PARAM];
|
||||
|
|
@ -88,7 +88,7 @@ const SearchFiltersComponent = props => {
|
|||
const featuresFilter = features ? (
|
||||
<SelectMultipleFilter
|
||||
name="amenities"
|
||||
urlParam={FEATURES_URL_PARAM}
|
||||
urlParam={AMENITIES_URL_PARAM}
|
||||
label={featuresLabel}
|
||||
onSelect={handleSelectOptions}
|
||||
options={features}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import {
|
|||
import css from './SearchFiltersMobile.css';
|
||||
|
||||
const CATEGORY_URL_PARAM = 'pub_category';
|
||||
const FEATURES_URL_PARAM = 'pub_amenities';
|
||||
const allowedCategories = [CATEGORY_URL_PARAM, FEATURES_URL_PARAM];
|
||||
const AMENITIES_URL_PARAM = 'pub_amenities';
|
||||
const allowedCategories = [CATEGORY_URL_PARAM, AMENITIES_URL_PARAM];
|
||||
|
||||
const validateParamValue = value => value !== null && value !== undefined && value.length > 0;
|
||||
const validateParamKey = key => allowedCategories.includes(key);
|
||||
|
|
@ -100,7 +100,7 @@ class SearchFiltersMobileComponent extends Component {
|
|||
resetAll(e) {
|
||||
const { urlQueryParams, history } = this.props;
|
||||
|
||||
const queryParams = omit(urlQueryParams, [CATEGORY_URL_PARAM, FEATURES_URL_PARAM]);
|
||||
const queryParams = omit(urlQueryParams, [CATEGORY_URL_PARAM, AMENITIES_URL_PARAM]);
|
||||
history.push(createResourceLocatorString('SearchPage', routeConfiguration(), {}, queryParams));
|
||||
|
||||
// blur event target if event is passed
|
||||
|
|
@ -168,14 +168,14 @@ class SearchFiltersMobileComponent extends Component {
|
|||
|
||||
const featuresLabel = intl.formatMessage({ id: 'SearchFiltersMobile.featuresLabel' });
|
||||
|
||||
const initialFeatures = !!urlQueryParams[FEATURES_URL_PARAM]
|
||||
? urlQueryParams[FEATURES_URL_PARAM].split(',')
|
||||
const initialFeatures = !!urlQueryParams[AMENITIES_URL_PARAM]
|
||||
? urlQueryParams[AMENITIES_URL_PARAM].split(',')
|
||||
: [];
|
||||
|
||||
const featuresFilter = features ? (
|
||||
<SelectMultipleFilterMobile
|
||||
name="amenities"
|
||||
urlParam={FEATURES_URL_PARAM}
|
||||
urlParam={AMENITIES_URL_PARAM}
|
||||
label={featuresLabel}
|
||||
onSelect={this.handleSelectMultiple}
|
||||
options={features}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue