@digione/node-custom-api 0.1.9-beta8 → 0.1.9-beta9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils/stream.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.1.9-beta8",
3
+ "version": "0.1.9-beta9",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/stream.js CHANGED
@@ -516,12 +516,17 @@ class StreamUtil {
516
516
  if (value && value.indexOf('lang:') > -1) {
517
517
  item['value'] = (0, i18n_1.__)({ phrase: value, locale: lang_code });
518
518
  }
519
+ if (!item['key'])
520
+ opt_empty = true;
519
521
  if (convert_value && item['key']) {
520
522
  obj_value[item['key']] = item['value'];
521
523
  }
522
524
  return item;
523
525
  });
524
526
  }
527
+ if (field_data['default_value'] && !opt_empty && (item['field_value'] == '' || item['field_value'] == null)) {
528
+ item['field_value'] = field_data['default_value'];
529
+ }
525
530
  if (convert_value && typeof item['field_value'] != "undefined") {
526
531
  let field_value = item['field_value'];
527
532
  if (item['field_value'] == null && opt_empty)