@reactionary/algolia 0.9.5 → 0.9.7

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.
@@ -18,7 +18,10 @@ class AlgoliaProductSearchFactory {
18
18
  for (const id in body.facets) {
19
19
  const values = body.facets[id];
20
20
  const facetId = FacetIdentifierSchema.parse({ key: id });
21
- facets.push(this.parseFacet(facetId, values));
21
+ const facet = this.parseFacet(facetId, values);
22
+ if (facet.values.length > 0) {
23
+ facets.push(facet);
24
+ }
22
25
  }
23
26
  const selectedCategoryFacet = query.search.facets.find((x) => x.facet.key === "categories") || query.search.categoryFilter;
24
27
  let subCategoryFacet;
@@ -85,6 +88,9 @@ class AlgoliaProductSearchFactory {
85
88
  name: facetIdentifier.key,
86
89
  values: []
87
90
  });
91
+ if (facetIdentifier.key === "categories") {
92
+ return result;
93
+ }
88
94
  for (const valueId in facetValues) {
89
95
  const count = facetValues[valueId];
90
96
  const facetValueIdentifier = FacetValueIdentifierSchema.parse({
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@reactionary/algolia",
3
- "version": "0.9.5",
3
+ "version": "0.9.7",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./src/index.d.ts",
7
7
  "dependencies": {
8
- "@reactionary/core": "0.9.5",
8
+ "@reactionary/core": "0.9.7",
9
9
  "zod": "4.1.9",
10
10
  "algoliasearch": "^5.48.0",
11
11
  "vitest": "^4.0.9",