@shopgate/pwa-common-commerce 7.31.8 → 7.31.9-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { router } from '@shopgate/pwa-common/helpers/router';
2
2
  import { hex2bin } from '@shopgate/pwa-common/helpers/data';
3
3
  import { buildFilterParamsForFetchFiltersRequest } from '@shopgate/engage/filter/helpers';
4
4
  import { CATEGORY_ALL_FILTER_PATTERN } from "../../category/constants";
5
+ import { SEARCH_FILTER_PATTERN } from "../../search/constants";
5
6
  import fetchCategory from "../../category/actions/fetchCategory";
6
7
  import { getShowAllProductsFilters } from "../../category/helpers";
7
8
  import fetchFilters from "../actions/fetchFilters";
@@ -16,6 +17,10 @@ export default function filters(subscribe) {
16
17
  dispatch,
17
18
  action
18
19
  }) => {
20
+ if (action?.route?.pattern === SEARCH_FILTER_PATTERN && !action.route.query?.s) {
21
+ // Filters can't be requested without a search phrase.
22
+ return;
23
+ }
19
24
  let {
20
25
  filters: routeFilters
21
26
  } = action?.route?.state || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common-commerce",
3
- "version": "7.31.8",
3
+ "version": "7.31.9-beta.2",
4
4
  "description": "Commerce library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -20,8 +20,8 @@
20
20
  "reselect": "^4.1.8"
21
21
  },
22
22
  "devDependencies": {
23
- "@shopgate/pwa-common": "7.31.8",
24
- "@shopgate/pwa-core": "7.31.8",
23
+ "@shopgate/pwa-common": "7.31.9-beta.2",
24
+ "@shopgate/pwa-core": "7.31.9-beta.2",
25
25
  "@types/lodash": "^4.17.24",
26
26
  "lodash": "^4.17.23",
27
27
  "react": "^17.0.2",
@@ -54,6 +54,10 @@ export default function search(subscribe) {
54
54
  });
55
55
  }
56
56
  }
57
+ if (!searchPhrase) {
58
+ // Nothing to search for - the search page shows its "no results" state.
59
+ return;
60
+ }
57
61
  const {
58
62
  hash,
59
63
  expired