Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass host, namespace into resource changes #146

Open
ShMcK opened this issue Jun 15, 2017 · 3 comments · May be fixed by #148
Open

pass host, namespace into resource changes #146

ShMcK opened this issue Jun 15, 2017 · 3 comments · May be fixed by #148
Assignees

Comments

@ShMcK
Copy link

ShMcK commented Jun 15, 2017

There should be a way to support namespaced (v2, v3) endpoints or changed urls with redux-json-api. Currently this is not supported with createResource, deleteResource & updateResource.

This could be handled with a few modifications to the state-mutation.js helpers file, or by granting the ability to overwrite the Axios config when needed.

Happy to put in a PR or take suggestions.

@Nopzen
Copy link
Collaborator

Nopzen commented Jun 20, 2017

Hi @ShMcK

It is correct understand that currently in the v1 we only support one Host / endpoint path, and the crud operations works of these.

To under stand your usecase you have 2 diffrent api paths https://api.myapi.io/api/ and https://api.mysite.io/second-api/ and you would like to have the ability to support have the ability to use witch ever in any given situration?

I think this would be a nice feature since you dont necessarily want one api to serve as a proxy for other api's it could be 3th party vendors that supports json api spec, i would like to see a possible solution from you, but i would urge you to take a look from the v2 branch as this is already handlign a lot of this setting up host and endpoints, maybe this could be expanded.

@Nopzen Nopzen self-assigned this Jun 20, 2017
@ShMcK
Copy link
Author

ShMcK commented Jun 21, 2017

I've put together a basic PR that allows for overwriting any axiosConfig keys.

ShMcK added a commit to ShMcK/redux-json-api that referenced this issue Jun 21, 2017
@ShMcK ShMcK linked a pull request Jun 21, 2017 that will close this issue
ShMcK added a commit to ShMcK/redux-json-api that referenced this issue Oct 9, 2017
Resolves redux-json-api#146.

overwrites existing config, rather than replacing it, as recommended by @egeriis.
@Nopzen
Copy link
Collaborator

Nopzen commented Mar 24, 2018

@egeriis i saw that you have been on this PR, could you handle this? it recurring question with #151 i think it would be a nice feature to have for sure in the V2 of things. Since Axios allows for multiple instances out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants