@infrab4a/connect 4.17.0 → 4.17.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/index.cjs.js CHANGED
@@ -4981,7 +4981,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4981
4981
  const mostRelevants = category.getMostRelevantByShop(shop);
4982
4982
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(category.products))];
4983
4983
  const products = [];
4984
- const { data: productsData } = await this.productRepository.find({
4984
+ const { data: productsData } = await this.productRepository.findCatalog({
4985
4985
  filters: {
4986
4986
  id: { operator: exports.Where.IN, value: mostRelevantProductsIds },
4987
4987
  published: true,
@@ -5020,13 +5020,13 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5020
5020
  stock: 'desc',
5021
5021
  name: 'asc',
5022
5022
  },
5023
- });
5023
+ }, shop === exports.Shops.MENSMARKET ? 'male' : 'female');
5024
5024
  const mostRelevantWithouyStock = productsData.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity <= 0);
5025
5025
  const firstProducts = productsData
5026
5026
  .filter((product) => mostRelevants.includes(product.id) && product.stock.quantity > 0)
5027
5027
  .sort((a, b) => mostRelevants.indexOf(a.id) - mostRelevants.indexOf(b.id));
5028
5028
  const lastProducts = productsData
5029
- .filter((product) => !mostRelevants.includes(product.id))
5029
+ .filter((product) => !mostRelevants.includes(product.id) && product.stock.quantity > 0)
5030
5030
  .concat(mostRelevantWithouyStock);
5031
5031
  const categoryMostRelevants = firstProducts.concat(lastProducts);
5032
5032
  const resultFinal = categoryMostRelevants.slice(0, options.limit);
package/index.esm.js CHANGED
@@ -4975,7 +4975,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4975
4975
  const mostRelevants = category.getMostRelevantByShop(shop);
4976
4976
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(category.products))];
4977
4977
  const products = [];
4978
- const { data: productsData } = await this.productRepository.find({
4978
+ const { data: productsData } = await this.productRepository.findCatalog({
4979
4979
  filters: {
4980
4980
  id: { operator: Where.IN, value: mostRelevantProductsIds },
4981
4981
  published: true,
@@ -5014,13 +5014,13 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5014
5014
  stock: 'desc',
5015
5015
  name: 'asc',
5016
5016
  },
5017
- });
5017
+ }, shop === Shops.MENSMARKET ? 'male' : 'female');
5018
5018
  const mostRelevantWithouyStock = productsData.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity <= 0);
5019
5019
  const firstProducts = productsData
5020
5020
  .filter((product) => mostRelevants.includes(product.id) && product.stock.quantity > 0)
5021
5021
  .sort((a, b) => mostRelevants.indexOf(a.id) - mostRelevants.indexOf(b.id));
5022
5022
  const lastProducts = productsData
5023
- .filter((product) => !mostRelevants.includes(product.id))
5023
+ .filter((product) => !mostRelevants.includes(product.id) && product.stock.quantity > 0)
5024
5024
  .concat(mostRelevantWithouyStock);
5025
5025
  const categoryMostRelevants = firstProducts.concat(lastProducts);
5026
5026
  const resultFinal = categoryMostRelevants.slice(0, options.limit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.17.0",
3
+ "version": "4.17.1",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },