@infrab4a/connect 5.4.0-beta.4 → 5.4.0-beta.6
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 +5 -6
- package/index.esm.js +5 -6
- package/package.json +1 -1
- package/src/domain/catalog/models/variant.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -3392,8 +3392,6 @@ class HasuraQueryBuilderHelper {
|
|
|
3392
3392
|
class HasuraRequestHelper {
|
|
3393
3393
|
static async fetch(params) {
|
|
3394
3394
|
const { variables, query, endpoint, headers, logger } = params;
|
|
3395
|
-
console.warn('variables', variables);
|
|
3396
|
-
console.warn('query', query);
|
|
3397
3395
|
const request = {
|
|
3398
3396
|
url: endpoint,
|
|
3399
3397
|
method: 'POST',
|
|
@@ -7905,6 +7903,7 @@ const fieldsConfiguration$2 = [
|
|
|
7905
7903
|
},
|
|
7906
7904
|
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7907
7905
|
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7906
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7908
7907
|
],
|
|
7909
7908
|
},
|
|
7910
7909
|
},
|
|
@@ -8015,6 +8014,9 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8015
8014
|
const result = await this.find({
|
|
8016
8015
|
filters: {
|
|
8017
8016
|
slug,
|
|
8017
|
+
productId: {
|
|
8018
|
+
operator: exports.Where.ISNULL,
|
|
8019
|
+
},
|
|
8018
8020
|
},
|
|
8019
8021
|
fields: this.fields.map((field) => typeof field === 'string' ? field : Object.keys(field).shift()),
|
|
8020
8022
|
options: {
|
|
@@ -8024,11 +8026,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8024
8026
|
if (!result.data.length)
|
|
8025
8027
|
return null;
|
|
8026
8028
|
const product = result?.data?.shift();
|
|
8027
|
-
if (product.productId) ;
|
|
8028
|
-
console.warn('product getBySlug', product);
|
|
8029
|
-
console.warn('vai entrar', !product.reviews.length && product.rate > 0);
|
|
8030
8029
|
if (!product.reviews.length && product.rate > 0) {
|
|
8031
|
-
console.warn('entrou');
|
|
8032
8030
|
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8033
8031
|
}
|
|
8034
8032
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
@@ -8689,6 +8687,7 @@ const fieldsConfiguration$1 = [
|
|
|
8689
8687
|
}),
|
|
8690
8688
|
},
|
|
8691
8689
|
},
|
|
8690
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
8692
8691
|
{ createdAt: { columnName: 'created_at' } },
|
|
8693
8692
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
8694
8693
|
];
|
package/index.esm.js
CHANGED
|
@@ -3368,8 +3368,6 @@ class HasuraQueryBuilderHelper {
|
|
|
3368
3368
|
class HasuraRequestHelper {
|
|
3369
3369
|
static async fetch(params) {
|
|
3370
3370
|
const { variables, query, endpoint, headers, logger } = params;
|
|
3371
|
-
console.warn('variables', variables);
|
|
3372
|
-
console.warn('query', query);
|
|
3373
3371
|
const request = {
|
|
3374
3372
|
url: endpoint,
|
|
3375
3373
|
method: 'POST',
|
|
@@ -7881,6 +7879,7 @@ const fieldsConfiguration$2 = [
|
|
|
7881
7879
|
},
|
|
7882
7880
|
{ tagsProfile: { columnName: 'tags_profile' } },
|
|
7883
7881
|
{ tagsCollection: { columnName: 'tags_collection' } },
|
|
7882
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
7884
7883
|
],
|
|
7885
7884
|
},
|
|
7886
7885
|
},
|
|
@@ -7991,6 +7990,9 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
7991
7990
|
const result = await this.find({
|
|
7992
7991
|
filters: {
|
|
7993
7992
|
slug,
|
|
7993
|
+
productId: {
|
|
7994
|
+
operator: Where.ISNULL,
|
|
7995
|
+
},
|
|
7994
7996
|
},
|
|
7995
7997
|
fields: this.fields.map((field) => typeof field === 'string' ? field : Object.keys(field).shift()),
|
|
7996
7998
|
options: {
|
|
@@ -8000,11 +8002,7 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
8000
8002
|
if (!result.data.length)
|
|
8001
8003
|
return null;
|
|
8002
8004
|
const product = result?.data?.shift();
|
|
8003
|
-
if (product.productId) ;
|
|
8004
|
-
console.warn('product getBySlug', product);
|
|
8005
|
-
console.warn('vai entrar', !product.reviews.length && product.rate > 0);
|
|
8006
8005
|
if (!product.reviews.length && product.rate > 0) {
|
|
8007
|
-
console.warn('entrou');
|
|
8008
8006
|
product.reviews = await this.findReviewsByProduct((product.productId ? product.productId : product.id), true);
|
|
8009
8007
|
}
|
|
8010
8008
|
RoundProductPricesHelper.roundProductPrices(product);
|
|
@@ -8665,6 +8663,7 @@ const fieldsConfiguration$1 = [
|
|
|
8665
8663
|
}),
|
|
8666
8664
|
},
|
|
8667
8665
|
},
|
|
8666
|
+
{ variantSlug: { columnName: 'variant_slug' } },
|
|
8668
8667
|
{ createdAt: { columnName: 'created_at' } },
|
|
8669
8668
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
8670
8669
|
];
|
package/package.json
CHANGED
|
@@ -4,5 +4,6 @@ export type ProductVariantIdentifiers = 'id' | 'productId';
|
|
|
4
4
|
export declare class Variant extends ProductBase<Variant, ProductVariantIdentifiers> {
|
|
5
5
|
productId: string;
|
|
6
6
|
grade?: VariantGrade[];
|
|
7
|
+
variantSlug?: string;
|
|
7
8
|
static get identifiersFields(): ProductVariantIdentifiers[];
|
|
8
9
|
}
|