@thefittingroom/shop-ui 1.2.2 → 1.2.3

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.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * thefittingroom v1.2.2 (2024-06-20T18:02:26.202Z)
2
+ * thefittingroom v1.2.3 (2024-06-20T18:12:34.387Z)
3
3
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
4
4
  */
5
5
  function loadImageRecursive(imageURL, imageURLs) {
@@ -47,7 +47,7 @@ const InitImageSlider = (sliderID, onChange) => {
47
47
  };
48
48
 
49
49
  /*!
50
- * thefittingroom v1.1.8 (2024-06-20T17:59:34.232Z)
50
+ * thefittingroom v1.1.10 (2024-06-20T18:11:48.643Z)
51
51
  * Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
52
52
  */
53
53
 
@@ -23009,6 +23009,15 @@ class TfrShop {
23009
23009
  return this.measurementLocations.has(location) ? this.measurementLocations.get(location) : location;
23010
23010
  });
23011
23011
  }
23012
+ async getStyleByBrandStyleId(brandStyleId) {
23013
+ try {
23014
+ const querySnapshot = await this.firebase.getDocs('styles', [rl('brand_style_id', '==', brandStyleId)]);
23015
+ return querySnapshot.docs[0].data();
23016
+ }
23017
+ catch (error) {
23018
+ return getFirebaseError(error);
23019
+ }
23020
+ }
23012
23021
  async getColorwaySizeAssets(styleId, skus) {
23013
23022
  const constraints = [rl('brand_id', '==', this.brandId)];
23014
23023
  if (styleId)
@@ -36704,7 +36713,8 @@ class TfrSizeRec {
36704
36713
  }
36705
36714
  catch (error) {
36706
36715
  try {
36707
- const sizes = await this.getRecommendedSizes(String(this.sku));
36716
+ const style = await this.tfrShop.getStyleByBrandStyleId(this.sku);
36717
+ const sizes = await this.getRecommendedSizes(String(style.id));
36708
36718
  return sizes;
36709
36719
  }
36710
36720
  catch (error) {
@@ -36765,8 +36775,8 @@ class FittingRoom {
36765
36775
  get sku() {
36766
36776
  return this.tfrSizeRec.sku;
36767
36777
  }
36768
- async checkIfPublished(styleId) {
36769
- const style = await this.tfrShop.getStyle(styleId);
36778
+ async checkIfPublished(brandStyleId) {
36779
+ const style = await this.tfrShop.getStyleByBrandStyleId(brandStyleId);
36770
36780
  return style.is_published;
36771
36781
  }
36772
36782
  setSku(sku) {