Closed fzaninotto closed 3 weeks ago
This has to be done at the fake server level, not at the collection or database level. FetchMock, MSW and Sinon adapters work properly, the problem only occurs in ra-data-fakerest
. That's where the fix should be done.
Problem
Calling
Collection.update()
with an object containingundefined
values erases the existing value.This does not mimic true REST APIs because, when the change payload is serialized to be passed to the network, undefined values are removed.
The erasure is unexpected.
Solution
Better mimic REST APIs by serializing / unserializing the changes before applying them.