@things-factory/product-base 4.3.642 → 4.3.654

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.
@@ -6,4 +6,5 @@ const product_mutation_1 = require("./product-mutation");
6
6
  const product_query_1 = require("./product-query");
7
7
  exports.entities = [product_1.Product];
8
8
  exports.resolvers = [product_query_1.ProductQuery, product_mutation_1.ProductMutation];
9
+ //product entity
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/product/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,yDAAoD;AACpD,mDAA8C;AAEjC,QAAA,QAAQ,GAAG,CAAC,iBAAO,CAAC,CAAA;AACpB,QAAA,SAAS,GAAG,CAAC,4BAAY,EAAE,kCAAe,CAAC,CAAA;AAExD,gBAAgB"}
@@ -188,7 +188,7 @@ async function updateMultipleProductDetail(productId, patches, context, multiple
188
188
  const barcodeInfo = ((_d = _createRecords[i]) === null || _d === void 0 ? void 0 : _d.productBarcodes) && ((_e = _createRecords[i]) === null || _e === void 0 ? void 0 : _e.productBarcodes.length) > 0
189
189
  ? (_f = _createRecords[i]) === null || _f === void 0 ? void 0 : _f.productBarcodes[0]
190
190
  : null;
191
- const newRecord = Object.assign(Object.assign({}, _createRecords[i]), { name: _createRecords[i].gtin ? _createRecords[i].gtin : _createRecords[i].name, gtin: (barcodeInfo === null || barcodeInfo === void 0 ? void 0 : barcodeInfo.gtin) || product.sku, refCode: _createRecords[i].refCode && _createRecords[i].refCode !== ''
191
+ const newRecord = Object.assign(Object.assign({}, _createRecords[i]), { name: _createRecords[i].name ? _createRecords[i].name : _createRecords[i].gtin, gtin: (barcodeInfo === null || barcodeInfo === void 0 ? void 0 : barcodeInfo.gtin) || product.sku, refCode: _createRecords[i].refCode && _createRecords[i].refCode !== ''
192
192
  ? _createRecords[i].refCode
193
193
  : product.sku + '-000' + productDetailCount, product, packingSize: _createRecords[i].packingSize <= 0 ? 1 : _createRecords[i].packingSize, childProductDetail: null, childQty: 0, domain: domain, creator: user, updater: user });
194
194
  const result = await productDetailRepo.save(newRecord);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/product-base",
3
- "version": "4.3.642",
3
+ "version": "4.3.654",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -26,5 +26,5 @@
26
26
  "@things-factory/biz-base": "^4.3.595",
27
27
  "@things-factory/routing-base": "^4.3.591"
28
28
  },
29
- "gitHead": "7796a1553e51d21f017f3746f80f25cae9e1c695"
29
+ "gitHead": "c5d37a4840c0af0a8ff131858cef69732ed284f5"
30
30
  }
@@ -4,3 +4,5 @@ import { ProductQuery } from './product-query'
4
4
 
5
5
  export const entities = [Product]
6
6
  export const resolvers = [ProductQuery, ProductMutation]
7
+
8
+ //product entity
@@ -184,7 +184,7 @@ export async function updateMultipleProductDetail(productId, patches, context: a
184
184
  : null
185
185
  const newRecord = {
186
186
  ..._createRecords[i],
187
- name: _createRecords[i].gtin ? _createRecords[i].gtin : _createRecords[i].name,
187
+ name: _createRecords[i].name ? _createRecords[i].name : _createRecords[i].gtin,
188
188
  gtin: barcodeInfo?.gtin || product.sku,
189
189
  refCode:
190
190
  _createRecords[i].refCode && _createRecords[i].refCode !== ''