@xuda.io/xuda-worker-bundle 1.3.2610 → 1.3.2612
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/index.js +12 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -666,12 +666,18 @@ func.runtime.bind.update_reference_source_array = async function (options) {
|
|
|
666
666
|
const field_type = func.runtime.bind.get_field_type(options.field_prop);
|
|
667
667
|
const reference_source_obj = options.iterate_info?.reference_source_obj;
|
|
668
668
|
if (!reference_source_obj || reference_source_obj.ret.type !== 'array' || options.iterate_info?.iterator_val !== options.bind_field_id) {
|
|
669
|
+
if (glb.DEBUG_MODE) {
|
|
670
|
+
console.info('[update_reference_source_array] GUARD FAILED:', 'has ref_obj:', !!reference_source_obj, 'type:', reference_source_obj?.ret?.type, 'iterator_val:', options.iterate_info?.iterator_val, 'bind_field_id:', options.bind_field_id);
|
|
671
|
+
}
|
|
669
672
|
return false;
|
|
670
673
|
}
|
|
671
674
|
|
|
672
675
|
const arr_idx = Number(options.iterate_info._key);
|
|
673
676
|
const dataset_arr = await func.datasource.get_value(options.SESSION_ID, reference_source_obj.fieldIdP, options.dsSessionP, reference_source_obj.currentRecordId);
|
|
674
677
|
let new_arr = _.cloneDeep(dataset_arr.ret.value);
|
|
678
|
+
if (glb.DEBUG_MODE) {
|
|
679
|
+
console.info('[update_reference_source_array] fieldIdP:', reference_source_obj.fieldIdP, 'arr_idx:', arr_idx, 'old_arr:', JSON.stringify(dataset_arr.ret.value), 'new_value:', options.value);
|
|
680
|
+
}
|
|
675
681
|
|
|
676
682
|
if (field_type === 'object' && options.val_is_reference_field) {
|
|
677
683
|
let obj_item = new_arr[arr_idx];
|
|
@@ -683,7 +689,13 @@ func.runtime.bind.update_reference_source_array = async function (options) {
|
|
|
683
689
|
}
|
|
684
690
|
|
|
685
691
|
let datasource_changes = func.runtime.bind.build_datasource_changes(options.dsSessionP, options.currentRecordId, reference_source_obj.fieldIdP, new_arr);
|
|
692
|
+
if (glb.DEBUG_MODE) {
|
|
693
|
+
console.info('[update_reference_source_array] calling datasource.update with new_arr:', JSON.stringify(new_arr), 'dsSessionP:', options.dsSessionP);
|
|
694
|
+
}
|
|
686
695
|
await func.datasource.update(options.SESSION_ID, datasource_changes);
|
|
696
|
+
if (glb.DEBUG_MODE) {
|
|
697
|
+
console.info('[update_reference_source_array] datasource.update completed');
|
|
698
|
+
}
|
|
687
699
|
return true;
|
|
688
700
|
};
|
|
689
701
|
func.runtime.resources.load_cdn = async function (SESSION_ID, resource) {
|