@infrab4a/connect 4.0.0-beta.22 → 4.0.0-beta.24

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.
@@ -2019,8 +2019,10 @@ class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
2019
2019
  interceptors,
2020
2020
  });
2021
2021
  this.homeCategoryGroupToPlain = (homeCategoryGroup) => ({
2022
- category: homeCategoryGroup.category?.toPlain(),
2023
- products: homeCategoryGroup.products?.map((product) => product?.toPlain()).filter(Boolean) || [],
2022
+ category: homeCategoryGroup?.category?.toPlain
2023
+ ? homeCategoryGroup?.category?.toPlain()
2024
+ : homeCategoryGroup?.category,
2025
+ products: homeCategoryGroup?.products?.map((product) => product?.toPlain()).filter(Boolean) || [],
2024
2026
  });
2025
2027
  this.plainToHomeCategoryGroup = (homeCategoryGroup) => ({
2026
2028
  category: Category.toInstance(homeCategoryGroup?.category),
@@ -2042,9 +2044,9 @@ class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
2042
2044
  }
2043
2045
  homeToFirestore(home) {
2044
2046
  if (home.data?.data) {
2045
- home.data.data.discoverProducts = home.data.data.discoverProducts.map(this.homeCategoryGroupToPlain);
2046
- home.data.data.featuredProducts = home.data.data.featuredProducts.map(this.homeCategoryGroupToPlain);
2047
- home.data.data.verticalProducts = home.data.data.verticalProducts.map(this.homeCategoryGroupToPlain);
2047
+ home.data.data.discoverProducts = home.data.data.discoverProducts?.map(this.homeCategoryGroupToPlain) || [];
2048
+ home.data.data.featuredProducts = home.data.data.featuredProducts?.map(this.homeCategoryGroupToPlain) || [];
2049
+ home.data.data.verticalProducts = home.data.data.verticalProducts?.map(this.homeCategoryGroupToPlain) || [];
2048
2050
  }
2049
2051
  return home;
2050
2052
  }