Closed go4cas closed 6 years ago
Okay, I see that in 2.9.0
a new beforeRequest
was introduced. I'm just not sure how to change the data object using this. Or, should I rather do the transformation in requestConfig
-> transformRequest
?
Hey @go4cas !
The beforeRequest
method was added to update your store optimistically (before you got the response from the server with the actual data).
If you need to transform your data doing it via requestConfig.transformRequest
is at the moment the proper way to go. Mhm. Maybe I should add another method to do this without fiddling in the requestConfig
. 🤔
I'll close this. Feel free to open a new issue.
First off ... awesome library!
I want to know if there is a way of transforming the request payload before calling the API? At present I can use
OnSuccess
to transform the response payload I get back from my back-end API, but for my use case I need to transform the payload, beforePOST
andPUT
requests.