@infrab4a/connect 4.3.9-beta.1 → 4.3.9-beta.11

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
@@ -4755,7 +4755,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4755
4755
  }
4756
4756
  }
4757
4757
  async getChildren(parentId) {
4758
- const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
4758
+ const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
4759
4759
  args: {
4760
4760
  type: 'category_tree_args',
4761
4761
  value: { parentid: parentId },
@@ -5177,7 +5177,10 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
5177
5177
  ], []);
5178
5178
  }
5179
5179
  async findCatalog(params, mainGender) {
5180
- return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign({ hasStock: 'desc' }, (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })), lodash.omit(params.orderBy, ['hasStock', 'intGender'])) }));
5180
+ return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true, gender: mainGender, stock: {
5181
+ quantity: { operator: exports.Where.GT, value: 0 },
5182
+ } }), orderBy: Object.assign({}, lodash.omit(params.orderBy, ['hasStock', 'intGender'])) }));
5183
+ // se a busca retornar menos que 24, faz consulta pelos sem estoque ou gender diferente
5181
5184
  }
5182
5185
  async updateCategories(productId, { categories }) {
5183
5186
  if ('action' in categories && categories.action === 'remove') {
package/index.esm.js CHANGED
@@ -4731,7 +4731,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
4731
4731
  }
4732
4732
  }
4733
4733
  async getChildren(parentId) {
4734
- const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
4734
+ const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
4735
4735
  args: {
4736
4736
  type: 'category_tree_args',
4737
4737
  value: { parentid: parentId },
@@ -5153,7 +5153,10 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
5153
5153
  ], []);
5154
5154
  }
5155
5155
  async findCatalog(params, mainGender) {
5156
- return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign({ hasStock: 'desc' }, (!mainGender ? {} : { intGender: mainGender === 'female' ? 'desc' : 'asc' })), omit(params.orderBy, ['hasStock', 'intGender'])) }));
5156
+ return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true, gender: mainGender, stock: {
5157
+ quantity: { operator: Where.GT, value: 0 },
5158
+ } }), orderBy: Object.assign({}, omit(params.orderBy, ['hasStock', 'intGender'])) }));
5159
+ // se a busca retornar menos que 24, faz consulta pelos sem estoque ou gender diferente
5157
5160
  }
5158
5161
  async updateCategories(productId, { categories }) {
5159
5162
  if ('action' in categories && categories.action === 'remove') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect",
3
- "version": "4.3.9-beta.1",
3
+ "version": "4.3.9-beta.11",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },