Comments (17)
@tomharvey Are you open to a PR for these changes?
@dvidsilva Let's see if Tom responds first π
from redux-json-api.
Time to close the issue?
from redux-json-api.
You simply want to specify the base URL in the Axios config. Thatβs the equivalent.
from redux-json-api.
Ok, I wrote that way:
store.dispatch(setAxiosConfig({
baseURL: 'https://my.api/v2',
headers: {
'Access-Token': currentUser()
}
}));
Now, how can I fetch an endpoint with its related resources (include)? Do I need to hardcode the include at the end of the path when using readEndpoint
?
from redux-json-api.
Yeah, readEndpoint
doesn't care about parsing the URL you're providing. So you can pass any query param through there.
from redux-json-api.
Thanks for the hard work @egeriis , using setAxiosConfig
worked perfect, Any plans for updated documentations and examples? the linked example repo still uses the old way.
I have some time this week, if no one else is on it I can take a stab at it.
from redux-json-api.
Good to hear @dvidsilva. Unfortunately the example repo is not in my control π
from redux-json-api.
The docs are updated. But be sure to check the 2.0 branch.
from redux-json-api.
@egeriis no problem. If I create a sample repo for v2 and is good, can it get linked? might be useful for other folks.
from redux-json-api.
@dvidsilva Oh yeah, for sure!
from redux-json-api.
@egeriis, does setAxiosConfig
accept any config option officially supported by Axios?
from redux-json-api.
@egeriis Actually this was faster, I changed the redux-json-api-demo repo to use v2, so people can also have an example of upgrading steps. https://github.com/dvidsilva/redux-json-api-demo
https://github.com/dvidsilva/redux-json-api-demo/commits/master
from redux-json-api.
@pedrovinicius Yes, any config option. They are passed directly.
from redux-json-api.
@egeriis I'm good with @dvidsilva approach if you guys are. I've yet to upgrade to v2 so I can't really comment on any details, but more than happy to have someone else feed into the guide.
Will be sure to raise a PR with @dvidsilva if I think of anything, while I upgrade to v2, which could help the guide.
from redux-json-api.
I've also merged @dvidsilva into my repo.
from redux-json-api.
Good call @tomharvey
from redux-json-api.
@egeriis sorry, the docs are still not updated, the configure still has the old docs, https://github.com/redux-json-api/redux-json-api/blob/v2.0.0/docs/set-up-configure.md
I can make some time this week and send a PR
from redux-json-api.
Related Issues (20)
- Workwith Immutable.js HOT 1
- Best Practice for 422 or 500 Errors HOT 2
- Update hydrateStore doc example
- resource.type vs collection endpoint uris HOT 5
- Add flow-typed
- Update set up configuration page to v2 Standards HOT 8
- Delete resource endpoint appears to use relative pathing HOT 5
- Links to state HOT 5
- Update state at next readEndpoint HOT 3
- Custom URL construction HOT 11
- Action type is undefined HOT 4
- Pagination URLs can be objects.
- Unable to start expo due to Node standard library dependency of keykey HOT 1
- angular @angular-redux process not defined HOT 6
- babel-runtime must be added manually to build
- Media Types (Content Negotiation) for mutlipart/form-data content type. Request for implementation. HOT 1
- Is there any known live fork of this repo? HOT 2
- getRelatedResources crashes if relationship data is null HOT 2
- Export instance of axios that used in requests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-json-api.