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
Hi,
I've tried to make a plugin, just like this one https://github.com/apicase/jsonapi
Copy/pasted the code, just changed normalization func. And the doRequest() stopped working.
When mergeOptions() happens the options get "normalized" (not sure what for). After this process the opts array looks like this:
0: {_isNormalized: true, adapter: {…}, payload: {…}, meta: {…}, options: {…}, …}
1: {_isNormalized: true}
...
Then this array is being reduced by this func - return payloadMerger(res, cur.payload);
So the 2nd item (index 1) in the array is breaking the merge logic, as there is no "payload" value.
The error is "Cannot read property 'url' of undefined" in this snippet happens, because "to" is undefined.
Hi,
I've tried to make a plugin, just like this one https://github.com/apicase/jsonapi
Copy/pasted the code, just changed normalization func. And the doRequest() stopped working.
When mergeOptions() happens the options get "normalized" (not sure what for). After this process the opts array looks like this:
0: {_isNormalized: true, adapter: {…}, payload: {…}, meta: {…}, options: {…}, …}
1: {_isNormalized: true}
...
Then this array is being reduced by this func - return payloadMerger(res, cur.payload);
So the 2nd item (index 1) in the array is breaking the merge logic, as there is no "payload" value.
The error is "Cannot read property 'url' of undefined" in this snippet happens, because "to" is undefined.
Definig hook locally in ApiService works as intended.
The text was updated successfully, but these errors were encountered: