@infrab4a/connect-angular 4.3.0 → 4.3.1-beta.1
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/esm2020/services/home-shop.service.mjs +8 -18
- package/fesm2015/infrab4a-connect-angular.mjs +7 -14
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +7 -17
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/services/home-shop.service.d.ts +0 -1
|
@@ -1995,11 +1995,7 @@ class HomeShopService {
|
|
|
1995
1995
|
getHomeData() {
|
|
1996
1996
|
return this.getHomeConfiguration().pipe(map((home) => (home?.data?.expiresAt > new Date() ? home : null)), concatMap((home) => home
|
|
1997
1997
|
? of(home)
|
|
1998
|
-
: forkJoin([
|
|
1999
|
-
this.getDiscoverProducts(this.gender),
|
|
2000
|
-
this.getFeaturedProducts(this.gender),
|
|
2001
|
-
this.getVerticalProducts(this.gender),
|
|
2002
|
-
]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
|
|
1998
|
+
: forkJoin([this.getDiscoverProducts(), this.getFeaturedProducts(), this.getVerticalProducts()]).pipe(map(([discoverProducts, featuredProducts, verticalProducts]) => ({
|
|
2003
1999
|
discoverProducts,
|
|
2004
2000
|
featuredProducts,
|
|
2005
2001
|
verticalProducts,
|
|
@@ -2021,18 +2017,15 @@ class HomeShopService {
|
|
|
2021
2017
|
getMinValueForFreeShipping() {
|
|
2022
2018
|
return this.getHomeConfiguration().pipe(map((home) => home.minValueForFreeShipping));
|
|
2023
2019
|
}
|
|
2024
|
-
getDiscoverProducts(
|
|
2025
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories
|
|
2020
|
+
getDiscoverProducts() {
|
|
2021
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.discoverCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2026
2022
|
}
|
|
2027
|
-
getFeaturedProducts(
|
|
2028
|
-
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories
|
|
2023
|
+
getFeaturedProducts() {
|
|
2024
|
+
return this.getHomeConfiguration().pipe(concatMap((home) => from(this.categoryRepository.getCategoriesForHome(home.featuredCategories)).pipe(map((groups) => groups.map(this.buildCategoryGroupWithRequiredData)))));
|
|
2029
2025
|
}
|
|
2030
|
-
getVerticalProducts(
|
|
2026
|
+
getVerticalProducts() {
|
|
2031
2027
|
return this.getHomeConfiguration().pipe(concatMap((home) => forkJoin(home.verticalCarousels.filter(Boolean).map((id) => from(this.categoryRepository.get({ id })).pipe(concatMap((category) => from(this.productRepository.find({
|
|
2032
|
-
filters: {
|
|
2033
|
-
categories: { operator: Where.IN, value: [category.id] },
|
|
2034
|
-
...(gender ? { tags: { operator: Where.IN, value: [gender] } } : {}),
|
|
2035
|
-
},
|
|
2028
|
+
filters: { categories: { operator: Where.IN, value: [category.id] } },
|
|
2036
2029
|
limits: { limit: 12 },
|
|
2037
2030
|
})).pipe(map((products) => ({ category, products })))), map(({ category, products }) => ({ category, products: products.data })), map(this.buildCategoryGroupWithRequiredData))))));
|
|
2038
2031
|
}
|
|
@@ -2054,9 +2047,6 @@ class HomeShopService {
|
|
|
2054
2047
|
data,
|
|
2055
2048
|
})).pipe(tap(() => (this.homeConfiguration.data = data)), map(() => this.homeConfiguration));
|
|
2056
2049
|
}
|
|
2057
|
-
get gender() {
|
|
2058
|
-
return this.homeId === 'mens_market' ? 'masculino' : undefined;
|
|
2059
|
-
}
|
|
2060
2050
|
}
|
|
2061
2051
|
HomeShopService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService, deps: [{ token: 'CategoryRepository' }, { token: 'HomeRepository' }, { token: 'ProductRepository' }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2062
2052
|
HomeShopService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: HomeShopService });
|