@stock-in-the-channel/sinch-vue-components 0.0.372 → 0.0.374

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.
Files changed (2) hide show
  1. package/dist/index.es.js +17 -13
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -20046,22 +20046,26 @@ const Z1 = window, hi = mn(), Xv = { limit: 20 }, cu = { data: [] }, Zv = {}, em
20046
20046
  headers: hi.headers,
20047
20047
  credentials: "include"
20048
20048
  }
20049
- ).then((c) => (window.sinch.checkIfNeedsLogin(c), c.json())).catch((c) => {
20050
- console.log("Error fetching /products/search-filters", c), c.status === 401 && window.sinch.goToLoginPage();
20049
+ ).then((u) => (window.sinch.checkIfNeedsLogin(u), u.json())).catch((u) => {
20050
+ console.log("Error fetching /products/search-filters", u), u.status === 401 && window.sinch.goToLoginPage();
20051
20051
  });
20052
20052
  this.filterResponse = cu;
20053
20053
  const i = ["InStock", "ProductTypes", "PriceBand"];
20054
- a && a.data && (this.filterResponse = a, this.filterResponse.data = this.filterResponse.data.filter(
20055
- (c) => !i.includes(c.name) && c.values.length > 0
20056
- )), this.filterLoading = !1;
20057
- const o = Object.entries(this.searchRequest).filter((c) => c[1] !== void 0), l = tk.filter((c) => o.find((u) => u[0] === c.urlParam)).map((c) => c.filterName), s = [];
20058
- for (const c of this.filterResponse.data) {
20059
- const u = c.values.find((d) => d.isSelected);
20060
- l.includes(c.name) && u && s.push(u.name);
20061
- }
20062
- if (this.searchRequest.text ? this.resultsFor = [this.searchRequest.text, ...s].join(", ") : this.resultsFor = s.join(", "), this.filterResponseCallBack && this.filterResponseCallBack(), this.searchResponseCallBacks)
20063
- for (const c of this.searchResponseCallBacks)
20064
- c(this.searchResults);
20054
+ if (a && a.filters) {
20055
+ var o = a.filters;
20056
+ this.filterResponse.data = o.filter(
20057
+ (u) => !i.includes(u.name) && u.values.length > 0
20058
+ );
20059
+ }
20060
+ this.filterLoading = !1;
20061
+ const l = Object.entries(this.searchRequest).filter((u) => u[1] !== void 0), s = tk.filter((u) => l.find((d) => d[0] === u.urlParam)).map((u) => u.filterName), c = [];
20062
+ for (const u of this.filterResponse.data) {
20063
+ const d = u.values.find((f) => f.isSelected);
20064
+ s.includes(u.name) && d && c.push(d.name);
20065
+ }
20066
+ if (this.searchRequest.text ? this.resultsFor = [this.searchRequest.text, ...c].join(", ") : this.resultsFor = c.join(", "), this.filterResponseCallBack && this.filterResponseCallBack(), this.searchResponseCallBacks)
20067
+ for (const u of this.searchResponseCallBacks)
20068
+ u(this.searchResults);
20065
20069
  },
20066
20070
  async configureRequestAndSearch(n, r, a) {
20067
20071
  let i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stock-in-the-channel/sinch-vue-components",
3
- "version": "0.0.372",
3
+ "version": "0.0.374",
4
4
  "files": [
5
5
  "dist"
6
6
  ],