@xuda.io/xuda-worker-bundle-min 1.3.865 → 1.3.867

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/index.js +25 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1950,7 +1950,7 @@ func.datasource.prepare = async function (
1950
1950
  delete _ds.v.old_dataSource; // to eliminate parse error
1951
1951
  delete _ds.rows_found;
1952
1952
  // _ds.raw_data = {};
1953
- _ds.data_feed = [];
1953
+ _ds.data_feed = {};
1954
1954
 
1955
1955
  _ds.v.old_dataSource = _.cloneDeep(_ds);
1956
1956
  } catch (err) {
@@ -2344,7 +2344,7 @@ func.datasource.execute = async function (
2344
2344
  filterModelUserSql: _ds.progDataSource.filterModelUserSql,
2345
2345
  };
2346
2346
 
2347
- _ds.data_feed = [];
2347
+ _ds.data_feed = {};
2348
2348
 
2349
2349
  _ds.v.raw_data = await func.db.get_query(
2350
2350
  SESSION_ID,
@@ -2644,7 +2644,9 @@ func.datasource.execute = async function (
2644
2644
  }
2645
2645
 
2646
2646
  const index = _raw_data_rows.findIndex((item) => item.id === rowId);
2647
-
2647
+ if (index === -1) {
2648
+ throw new Error(`ROWID "${rowId}" not found`);
2649
+ }
2648
2650
  return index;
2649
2651
  };
2650
2652
 
@@ -3191,6 +3193,26 @@ func.datasource.run_rows_form = async function (
3191
3193
 
3192
3194
  var idx = rowIdxP;
3193
3195
 
3196
+ const find_ROWID_idx_from_raw_data_arr = function (rowId) {
3197
+ if (!_raw_data_rows) {
3198
+ throw new Error("_raw_data_rows not found");
3199
+ }
3200
+
3201
+ const index = _ds.v.raw_data.rows.findIndex((item) => item.id === rowId);
3202
+ if (index === -1) {
3203
+ throw new Error(`item.id "${rowId}" not found`);
3204
+ }
3205
+ return index;
3206
+ };
3207
+
3208
+ try {
3209
+ idx = find_ROWID_idx_from_raw_data_arr(raw_data_row.id);
3210
+ } catch (e) {
3211
+ _ROWID = "newRecord";
3212
+ _ds.data_feed.rows.push({ _ROWID });
3213
+ idx = func.common.find_ROWID_idx(_ds, _ROWID);
3214
+ }
3215
+
3194
3216
  // try {
3195
3217
  // if (typeof val !== "undefined") {
3196
3218
  // idx = rowIdxP;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.865",
3
+ "version": "1.3.867",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {