vtb-appit 0.0.36 → 0.0.37

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.
@@ -108,20 +108,20 @@ class AppitBaseTransformer {
108
108
  return result;
109
109
  }
110
110
 
111
- tsDataProductField(fieldId)
111
+ tsDataProductField(productId, fieldId)
112
112
  {
113
113
  let result = '';
114
114
 
115
115
  if(this.tsData && this.tsData.product) {
116
- Object.keys(this.tsData.product).forEach(key => {
117
- if(this.tsData.product[key].extraFields && this.tsData.product[key].extraFields.length) {
118
- this.tsData.product[key].extraFields.forEach(extraField => {
116
+ if(this.tsData.product.hasOwnProperty(productId)) {
117
+ if(this.tsData.product[productId].extraFields && this.tsData.product[productId].extraFields.length) {
118
+ this.tsData.product[productId].extraFields.forEach(extraField => {
119
119
  if(extraField.field_id === fieldId) {
120
120
  result = extraField.value;
121
121
  }
122
122
  });
123
123
  }
124
- });
124
+ }
125
125
  }
126
126
  console.log(result);
127
127
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vtb-appit",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {