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
{{ message }}
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
Describe the bug
In v15.1.1 I am unable to globally define Response Resolution at the RestfulProvider level.
To Reproduce
The following does not work to provide function to resolve in RestfulProvider. The data arrives in Component.js unmodified, in its original shape.
// In index.js<RestfulProviderbase="http://127.0.0.1:28080/api/v1/"resolve={(data)=>humps.camelizeKeys(data)}// THIS DOES NOT WORKrequestOptions={()=>({headers: {Authorization: authorization},})}><App/></RestfulProvider>// In Component.jsconstComponent=()=>{const{ data, loading }=useGet({path: '/items',});return(<ul>{data&&data.items.map((item)=>(<likey={item.itemId}>{item.itemName}</li>))}</ul>);};
However, when providing function to resolve in useGet hook from context consuming component it does work.
// In index.js<RestfulProviderbase="http://127.0.0.1:28080/api/v1/"requestOptions={()=>({headers: {Authorization: authorization},})}><App/></RestfulProvider>// In Component.jsconstComponent=()=>{const{ data, loading }=useGet({path: '/items',resolve: (data)=>humps.camelizeKeys(data),// THIS DOES WORK});return(<ul>{data&&data.items.map((item)=>(<likey={item.itemId}>{item.itemName}</li>))}</ul>);};
The text was updated successfully, but these errors were encountered:
Could you add response status to the arguments when calling the provided resolve function. In my use case I would like to treat success and error data differently
Describe the bug
In v15.1.1 I am unable to globally define Response Resolution at the
RestfulProvider
level.To Reproduce
The following does not work to provide function to
resolve
inRestfulProvider
. Thedata
arrives in Component.js unmodified, in its original shape.However, when providing function to
resolve
inuseGet
hook from context consuming component it does work.The text was updated successfully, but these errors were encountered: