drf-react-by-schema 0.15.1 → 0.15.2

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.
@@ -195,7 +195,12 @@ function APIWrapper({ handleLoading, setSnackBar, setDialog, children }) {
195
195
  });
196
196
  if (setValue && getValues) {
197
197
  const targetKey = fieldKey && index >= 0 ? `${fieldKey}.${index}.${model}` : model;
198
- const newValue = Object.assign(Object.assign(Object.assign({}, getValues(targetKey)), data), { label: data[labelKey] });
198
+ const value = getValues(targetKey);
199
+ const newValue = Array.isArray(value)
200
+ ? value.map((item) => {
201
+ return item.id === data.id ? data : item;
202
+ })
203
+ : Object.assign(Object.assign(Object.assign({}, value), data), { label: data[labelKey] });
199
204
  setValue(targetKey, newValue);
200
205
  populateOptionsAC([model]);
201
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drf-react-by-schema",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Components and Tools for building a React App having Django Rest Framework (DRF) as server",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",