-
Notifications
You must be signed in to change notification settings - Fork 81
addResponseInterceptor doesn't alter data #88
Comments
+1 |
I don't understand the syntax of the response interceptor you posted, is it just es6?
should work, if you figure out how this works differently from what you posted we should put a note in the docs. |
What I see is that its merging my modified items into the original structure somehow. from the addResponseInterceptor call, I do the following
The result of RestClientData(data) as an example, is as follows:
However, in the promise then callback, I console.log dump the response.body().data() and I get
where _embedded and _links are from the original response that I intercepted and passed into RestClientData(data) function call. So, it appears to be merging the returned data structure, with the one it already had. This isn't really desired behaviour, but perhaps its a way to deal with chaining multiple response interceptors? But in this case, perhaps the solution is that each subsequent interceptor receives the data structure from the previously executed one? |
Any update on this? This is still an issue. |
I have the same issue I tried with:
for seeing if the data is altered but it does not work. |
I have the same issue: I get I can use my collection by calling |
My backend returns colections and items in objects with a collection key (e.g.
{books: [...]}
).I can't configure restful.js to handle this (BTW this should be possible, keyed responses are a standart), so I've tried to add Response Interceptorto alter data manually. But it simply doesn't work: it gets data, I can use it, but in subsequent code I keep seeing original data.
The text was updated successfully, but these errors were encountered: