@infrab4a/connect 4.25.0-beta.8 → 4.25.0-beta.9

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
@@ -5707,12 +5707,10 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5707
5707
  const mostRelevants = category.getMostRelevantByShop(shop);
5708
5708
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(category.products))];
5709
5709
  const products = [];
5710
- const { data: productsData } = await this.productRepository.findCatalog({
5711
- filters: {
5712
- id: { operator: exports.Where.IN, value: mostRelevantProductsIds },
5713
- published: true,
5714
- },
5715
- fields: [
5710
+ const { data: productsData } = await this.productRepository.findCatalog(Object.assign(Object.assign({ filters: Object.assign({ id: {
5711
+ operator: exports.Where.IN,
5712
+ value: mostRelevantProductsIds,
5713
+ }, published: true }, (options.hasStock ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})) }, (options.limit ? { limit: options.limit } : {})), { fields: [
5716
5714
  'id',
5717
5715
  'name',
5718
5716
  'slug',
@@ -5738,15 +5736,12 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5738
5736
  'shoppingCount',
5739
5737
  'gender',
5740
5738
  'createdAt',
5741
- ],
5742
- options: { enableCount: false },
5743
- orderBy: {
5739
+ ], options: { enableCount: false }, orderBy: {
5740
+ stock: 'desc',
5744
5741
  shoppingCount: 'desc',
5745
5742
  rate: 'desc',
5746
- stock: 'desc',
5747
5743
  name: 'asc',
5748
- },
5749
- }, shop === exports.Shops.MENSMARKET ? 'male' : 'female', optionsCache);
5744
+ } }), shop === exports.Shops.MENSMARKET ? 'male' : 'female', optionsCache);
5750
5745
  const mostRelevantWithouyStock = productsData.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity <= 0);
5751
5746
  const firstProducts = productsData
5752
5747
  .filter((product) => mostRelevants.includes(product.id) && product.stock.quantity > 0)
package/index.esm.js CHANGED
@@ -5701,12 +5701,10 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5701
5701
  const mostRelevants = category.getMostRelevantByShop(shop);
5702
5702
  const mostRelevantProductsIds = [...new Set(mostRelevants.concat(category.products))];
5703
5703
  const products = [];
5704
- const { data: productsData } = await this.productRepository.findCatalog({
5705
- filters: {
5706
- id: { operator: Where.IN, value: mostRelevantProductsIds },
5707
- published: true,
5708
- },
5709
- fields: [
5704
+ const { data: productsData } = await this.productRepository.findCatalog(Object.assign(Object.assign({ filters: Object.assign({ id: {
5705
+ operator: Where.IN,
5706
+ value: mostRelevantProductsIds,
5707
+ }, published: true }, (options.hasStock ? { stock: { quantity: { operator: Where.GT, value: 0 } } } : {})) }, (options.limit ? { limit: options.limit } : {})), { fields: [
5710
5708
  'id',
5711
5709
  'name',
5712
5710
  'slug',
@@ -5732,15 +5730,12 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
5732
5730
  'shoppingCount',
5733
5731
  'gender',
5734
5732
  'createdAt',
5735
- ],
5736
- options: { enableCount: false },
5737
- orderBy: {
5733
+ ], options: { enableCount: false }, orderBy: {
5734
+ stock: 'desc',
5738
5735
  shoppingCount: 'desc',
5739
5736
  rate: 'desc',
5740
- stock: 'desc',
5741
5737
  name: 'asc',
5742
- },
5743
- }, shop === Shops.MENSMARKET ? 'male' : 'female', optionsCache);
5738
+ } }), shop === Shops.MENSMARKET ? 'male' : 'female', optionsCache);
5744
5739
  const mostRelevantWithouyStock = productsData.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity <= 0);
5745
5740
  const firstProducts = productsData
5746
5741
  .filter((product) => mostRelevants.includes(product.id) && product.stock.quantity > 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.25.0-beta.8",
3
+ "version": "4.25.0-beta.9",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },