@infrab4a/connect-angular 4.19.0-beta.2 → 4.19.0-beta.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/esm2020/services/catalog/catalog.service.mjs +19 -1
- package/fesm2015/infrab4a-connect-angular.mjs +18 -1
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +18 -0
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
- package/services/catalog/catalog.service.d.ts +1 -0
|
@@ -1390,6 +1390,21 @@ class CatalogService {
|
|
|
1390
1390
|
this.productSearch = productSearch;
|
|
1391
1391
|
this.productsByTerm = {};
|
|
1392
1392
|
this.brandsList = {};
|
|
1393
|
+
this.fields = [
|
|
1394
|
+
'id',
|
|
1395
|
+
'stock',
|
|
1396
|
+
'gender',
|
|
1397
|
+
'EAN',
|
|
1398
|
+
'name',
|
|
1399
|
+
'rate',
|
|
1400
|
+
'price',
|
|
1401
|
+
'published',
|
|
1402
|
+
'brand',
|
|
1403
|
+
'gender',
|
|
1404
|
+
'stock',
|
|
1405
|
+
'evaluation',
|
|
1406
|
+
'slug',
|
|
1407
|
+
];
|
|
1393
1408
|
this.buildFilterQuery = ({ clubDiscount, brands, prices, gender, tags, rate, customOptions, }) => {
|
|
1394
1409
|
const filters = {};
|
|
1395
1410
|
if (clubDiscount?.length)
|
|
@@ -1498,6 +1513,7 @@ class CatalogService {
|
|
|
1498
1513
|
return this.findCatalogAndSortByMostRevelant(mostRelevant, productsIds, options, limits, optionsCache);
|
|
1499
1514
|
}
|
|
1500
1515
|
const repoParams = {
|
|
1516
|
+
fields: this.fields,
|
|
1501
1517
|
filters: {
|
|
1502
1518
|
...(await this.buildMainFilter(options)),
|
|
1503
1519
|
...this.buildFilterQuery(options?.filters || {}),
|
|
@@ -1530,6 +1546,7 @@ class CatalogService {
|
|
|
1530
1546
|
const brandsList = this.brandsList[this.buildIndexBrands(options)];
|
|
1531
1547
|
const mostRelevantProductsIds = [...new Set(mostRelevants.concat(productIds))];
|
|
1532
1548
|
const totalResult = await this.productRepository.findCatalog({
|
|
1549
|
+
fields: this.fields,
|
|
1533
1550
|
filters: {
|
|
1534
1551
|
id: { operator: Where.IN, value: mostRelevantProductsIds },
|
|
1535
1552
|
...this.buildFilterQuery(options?.filters || {}),
|
|
@@ -1596,6 +1613,7 @@ class CatalogService {
|
|
|
1596
1613
|
filters: {
|
|
1597
1614
|
id: { operator: Where.IN, value: orderedId },
|
|
1598
1615
|
},
|
|
1616
|
+
fields: this.fields,
|
|
1599
1617
|
});
|
|
1600
1618
|
await this.setBrandsList(options, totalResult.distinct?.brand);
|
|
1601
1619
|
return {
|