Hi,
I have a REST API that uses server-side record versioning validations ...
Whenever I do a PUT to update a record, the client provides the current version of the record in my payload and the server
makes sure that this is still the latest version before proceeding with the actual update.
If the version has been updated by somebody else before I perform my PUT, the server returns an HTTP301 which I can
intercept. I currently handle this in my transformResponse() method (that part is fine) ...
Here's what I would like :
1) display a warning message to the user (that I already achieve by adding an entry to dsResponse.errors)
2) perform a fetch (GET) to reload the updated version of the record and have my dynamic form / values manager
display the latest values, ready for the user to re-do his changes and click save again.
For #2, I tried doing a fetch() and issuing an updateCaches() call directly from within my datasource.transformResponse()
but that didn't work.
Any idea how this should be handled ? Anything already built-in the ISC framework to handle record versioning ?
Thanks,
I have a REST API that uses server-side record versioning validations ...
Whenever I do a PUT to update a record, the client provides the current version of the record in my payload and the server
makes sure that this is still the latest version before proceeding with the actual update.
If the version has been updated by somebody else before I perform my PUT, the server returns an HTTP301 which I can
intercept. I currently handle this in my transformResponse() method (that part is fine) ...
Here's what I would like :
1) display a warning message to the user (that I already achieve by adding an entry to dsResponse.errors)
2) perform a fetch (GET) to reload the updated version of the record and have my dynamic form / values manager
display the latest values, ready for the user to re-do his changes and click save again.
For #2, I tried doing a fetch() and issuing an updateCaches() call directly from within my datasource.transformResponse()
but that didn't work.
Any idea how this should be handled ? Anything already built-in the ISC framework to handle record versioning ?
Thanks,
Comment