You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In UPDATE requests, we should ideally not include fields that are unchanged. Besides being unnecessary, it can cause issues:
Conflicts can happen when different users edit different fields of same record at same time. In this scenario, one user's changes will get undone. Similarly, if an automatic process (e.g. e-commerce checkout) updates a field (e.g. inventoryCount) while a user is editing another field of the same record, then when the user clicks Save, the update from the automatic process will be undone.
A user may not have permission to update every field. In this scenario they will get permissions errors when they try to edit the fields they do have permission to edit.
Of course, the alternative to pulling in this new dependency would be JSON.stringify(a) === JSON.stringify(b) but that can give false negatives if order of properties don't match (not really sure if that would be a concern in this case).
In UPDATE requests, we should ideally not include fields that are unchanged. Besides being unnecessary, it can cause issues:
inventoryCount
) while a user is editing another field of the same record, then when the user clicks Save, the update from the automatic process will be undone.react-admin's
UpdateParams
objects have apreviousData
property that you can compare withdata
to see which fields have been changed:https://github.com/marmelab/react-admin/blob/0796893e4989716cb6e11a5cfef767a2ed4c263e/packages/ra-core/src/types.ts#L171-L176
The text was updated successfully, but these errors were encountered: