@infrab4a/connect 4.3.9-beta.14 → 4.3.9-beta.2
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
|
@@ -4114,7 +4114,9 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4114
4114
|
...acc,
|
|
4115
4115
|
{
|
|
4116
4116
|
[AttributeOptionHelper.FindByAttribute(current, fields)
|
|
4117
|
-
.columnName]: orderBy[current]
|
|
4117
|
+
.columnName]: orderBy[current] === 'asc'
|
|
4118
|
+
? 'asc_nulls_last'
|
|
4119
|
+
: 'desc_nulls_last',
|
|
4118
4120
|
},
|
|
4119
4121
|
], []);
|
|
4120
4122
|
this.bindAggretageAttributes = (aggregates, fields) => {
|
|
@@ -4753,7 +4755,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4753
4755
|
}
|
|
4754
4756
|
}
|
|
4755
4757
|
async getChildren(parentId) {
|
|
4756
|
-
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
4758
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
|
|
4757
4759
|
args: {
|
|
4758
4760
|
type: 'category_tree_args',
|
|
4759
4761
|
value: { parentid: parentId },
|
|
@@ -5175,12 +5177,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5175
5177
|
], []);
|
|
5176
5178
|
}
|
|
5177
5179
|
async findCatalog(params, mainGender) {
|
|
5178
|
-
return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign(
|
|
5179
|
-
// order by stock tbm maior menor
|
|
5180
|
-
// sempre duas condições
|
|
5181
|
-
// verificar se tem empate
|
|
5182
|
-
// null tá aparecendo primeiro no melhor rating
|
|
5183
|
-
// testear com desc null last e verificar empate
|
|
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'])) }));
|
|
5184
5181
|
}
|
|
5185
5182
|
async updateCategories(productId, { categories }) {
|
|
5186
5183
|
if ('action' in categories && categories.action === 'remove') {
|
package/index.esm.js
CHANGED
|
@@ -4090,7 +4090,9 @@ const withFindHasuraGraphQL = (MixinBase) => {
|
|
|
4090
4090
|
...acc,
|
|
4091
4091
|
{
|
|
4092
4092
|
[AttributeOptionHelper.FindByAttribute(current, fields)
|
|
4093
|
-
.columnName]: orderBy[current]
|
|
4093
|
+
.columnName]: orderBy[current] === 'asc'
|
|
4094
|
+
? 'asc_nulls_last'
|
|
4095
|
+
: 'desc_nulls_last',
|
|
4094
4096
|
},
|
|
4095
4097
|
], []);
|
|
4096
4098
|
this.bindAggretageAttributes = (aggregates, fields) => {
|
|
@@ -4729,7 +4731,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4729
4731
|
}
|
|
4730
4732
|
}
|
|
4731
4733
|
async getChildren(parentId) {
|
|
4732
|
-
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
4734
|
+
const { category_tree } = await this.query('category_tree', ['id', 'name', 'parent_id', 'slug', 'reference'], {
|
|
4733
4735
|
args: {
|
|
4734
4736
|
type: 'category_tree_args',
|
|
4735
4737
|
value: { parentid: parentId },
|
|
@@ -5151,12 +5153,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
5151
5153
|
], []);
|
|
5152
5154
|
}
|
|
5153
5155
|
async findCatalog(params, mainGender) {
|
|
5154
|
-
return this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign(Object.assign(
|
|
5155
|
-
// order by stock tbm maior menor
|
|
5156
|
-
// sempre duas condições
|
|
5157
|
-
// verificar se tem empate
|
|
5158
|
-
// null tá aparecendo primeiro no melhor rating
|
|
5159
|
-
// testear com desc null last e verificar empate
|
|
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'])) }));
|
|
5160
5157
|
}
|
|
5161
5158
|
async updateCategories(productId, { categories }) {
|
|
5162
5159
|
if ('action' in categories && categories.action === 'remove') {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonFunctionAndIdentifierPropertyNames } from '../../model/types/non-function-property-name.type';
|
|
2
2
|
export type RepositoryOrderBy<Model> = {
|
|
3
|
-
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc'
|
|
3
|
+
[key in NonFunctionAndIdentifierPropertyNames<Model>]?: 'asc' | 'desc';
|
|
4
4
|
};
|
|
5
5
|
export type RepositoryOrderByList<Model> = RepositoryOrderBy<Model>[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Shops } from '../../catalog';
|
|
1
2
|
import { BaseModel, GenericIdentifier } from '../../generic/model';
|
|
2
3
|
import { MenuNav } from './types/menu-nav.type';
|
|
3
4
|
export declare class ShopMenu extends BaseModel<ShopMenu> {
|
|
4
5
|
menuNav: MenuNav[];
|
|
6
|
+
shop: Shops;
|
|
5
7
|
id: string;
|
|
6
8
|
static get identifiersFields(): GenericIdentifier[];
|
|
7
9
|
}
|