@infrab4a/connect 3.10.0-beta.4 → 3.10.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/bundles/infrab4a-connect.umd.js +10 -4
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/domain/catalog/models/product.js +6 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +6 -2
- package/esm2015/infra/hasura-graphql/models/product-hasura-graphql.js +1 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +2 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +4 -3
- package/fesm2015/infrab4a-connect.js +13 -4
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +1 -0
- package/package.json +1 -1
|
@@ -813,6 +813,10 @@ class Product extends BaseModel {
|
|
|
813
813
|
return ['id'];
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
+
__decorate([
|
|
817
|
+
Type(() => Category),
|
|
818
|
+
__metadata("design:type", Category)
|
|
819
|
+
], Product.prototype, "category", void 0);
|
|
816
820
|
__decorate([
|
|
817
821
|
Type(() => KitProduct),
|
|
818
822
|
__metadata("design:type", Array)
|
|
@@ -2290,7 +2294,11 @@ GraphQLFieldHelper.ConvertFieldValueTo = (instance, fields, update = false) => {
|
|
|
2290
2294
|
if (!!foreignKeyColumn &&
|
|
2291
2295
|
!isEmpty(foreignKeyColumn) &&
|
|
2292
2296
|
!Object.keys(foreignKeyColumn).filter((key) => { var _a; return !((_a = data[attributeName]) === null || _a === void 0 ? void 0 : _a[key]); }).length)
|
|
2293
|
-
return Object.keys(foreignKeyColumn).reduce((object, current) => {
|
|
2297
|
+
return Object.keys(foreignKeyColumn).reduce((object, current) => {
|
|
2298
|
+
var _a;
|
|
2299
|
+
const { columnName: foreignColumnName } = AttributeOptionHelper.FindByAttribute(foreignKeyColumn[current], fields);
|
|
2300
|
+
return Object.assign(Object.assign({}, object), { [foreignColumnName]: (_a = data[attributeName]) === null || _a === void 0 ? void 0 : _a[current] });
|
|
2301
|
+
}, Object.assign({}, result));
|
|
2294
2302
|
if (update && isObject(data[attributeName]) && !isNil(attributeFields) && !isDate(data[attributeName]))
|
|
2295
2303
|
return result;
|
|
2296
2304
|
if (!!columnName && Array.isArray(attributeFields) && isObject(data[attributeName])) {
|
|
@@ -2729,7 +2737,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
2729
2737
|
{
|
|
2730
2738
|
parent: {
|
|
2731
2739
|
columnName: 'parent',
|
|
2732
|
-
foreignKeyColumn: {
|
|
2740
|
+
foreignKeyColumn: { id: 'parentId' },
|
|
2733
2741
|
fields: ['id', 'name', 'reference', 'slug'],
|
|
2734
2742
|
},
|
|
2735
2743
|
},
|
|
@@ -3237,10 +3245,11 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
3237
3245
|
},
|
|
3238
3246
|
},
|
|
3239
3247
|
{ shoppingCount: { columnName: 'shopping_count' } },
|
|
3248
|
+
{ categoryId: { columnName: 'category_id' } },
|
|
3240
3249
|
{
|
|
3241
3250
|
category: {
|
|
3242
|
-
columnName: '
|
|
3243
|
-
foreignKeyColumn: {
|
|
3251
|
+
columnName: 'category',
|
|
3252
|
+
foreignKeyColumn: { id: 'categoryId' },
|
|
3244
3253
|
fields: ['id', 'name', 'reference', 'slug'],
|
|
3245
3254
|
},
|
|
3246
3255
|
},
|