Merge pull request #708 from sharetribe/country-search-filter-bug

Fix a bug where country param is dropped from search url when using a filter
This commit is contained in:
Hannu Lyytikäinen 2018-02-15 17:10:26 +02:00 committed by GitHub
commit a686e7c094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -73,11 +73,12 @@ const validURLParamForExtendedData = (paramKey, urlParams) => {
// extract search parameters, including a custom attribute named category
const pickSearchParamsOnly = params => {
const { address, origin, bounds, ...rest } = params || {};
const { address, origin, bounds, country, ...rest } = params || {};
return {
address,
origin,
bounds,
country,
...validURLParamForExtendedData(CATEGORY_URL_PARAM, rest),
...validURLParamForExtendedData(AMENITIES_URL_PARAM, rest),
};

View file

@ -55,6 +55,7 @@ exports[`SearchPageComponent matches snapshot 1`] = `
Object {
"address": undefined,
"bounds": undefined,
"country": undefined,
"origin": undefined,
}
}
@ -97,6 +98,7 @@ exports[`SearchPageComponent matches snapshot 1`] = `
Object {
"address": undefined,
"bounds": undefined,
"country": undefined,
"origin": undefined,
}
}