@xuda.io/runtime-bundle 1.0.658 → 1.0.660

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.
@@ -32068,8 +32068,24 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32068
32068
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
32069
32069
 
32070
32070
  if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
32071
- let value_before_cast = await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId);
32071
+ let arr_value_before_cast = (await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value;
32072
+ let value_from_getter = bind.getter($elm[0]);
32073
+ let value;
32074
+ if (arr_value_before_cast.includes(value_from_getter)) {
32075
+ value = arr_value_before_cast.filter((item) => item !== value_from_getter);
32076
+ } else {
32077
+ value.push(value_from_getter);
32078
+ }
32079
+
32080
+ let datasource_changes = {
32081
+ [_dsP]: {
32082
+ [_ds.currentRecordId]: {
32083
+ [bind_field_id]: value,
32084
+ },
32085
+ },
32086
+ };
32072
32087
  debugger;
32088
+ return await func.datasource.update(SESSION_ID, datasource_changes);
32073
32089
  }
32074
32090
 
32075
32091
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));