-
Notifications
You must be signed in to change notification settings - Fork 11
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
POST/PUT response handling expects full object is returned in repsonse #3
Comments
On similar note my list API returns custom object containing multiple lists. Right now there's no way to accept such response. Is it intentional? |
It's intentional in the sense that I only did enough to get things working with my backend. Adding Do you have an example of returning multiple lists? We could allow further customisation if there's a good use case. |
There's a home screen where I return multiple type of cards(data). E.g. Region, City, Hotel, Staff Picks, etc. The response is something like
|
I think, strictly speaking, that isn't quite RESTful but, for pragmatic reasons, most APIs aren't. I could imagine something like: const API = {
'/api/': {
"regions": types.List(...)
"cities": types.List(...)
}
}; but that's not really RESTful and outside the scope of this library I think. The best thing is probably to make sure you can easily use redux-rest, for 'regular' endpoints, along side your own code for special cases. |
I totally understand that. But on mobile devices for India like demographics we try to minimize number of API calls. |
Yes, I understand that (hence my pragmatism point). It's also why On 3 March 2016 at 09:21, Bhoomit notifications@github.com wrote:
|
Yes, It does makes sense. I didn't know about Relay/GraphQL. So went ahead and read about it. And yes it does seem like the way forward. Unfortunately, right now its hard for us to move to that as there are apps which are already using the APIs. Anyway thanks for the tip. |
No problem. I think REST APIs will be around for a while which is why I On 3 March 2016 at 13:44, Bhoomit notifications@github.com wrote:
|
For now what I did in my fork is this:
|
Ok, that's fine for retrieving items. I guess creating, updating items On 3 March 2016 at 14:15, Bhoomit notifications@github.com wrote:
|
This was just a quick fix. I didn't test it with other operations. Will check when I get there. Once I'm sure about it, I will send a PR. |
Great, thanks. On 5 March 2016 at 16:28, Bhoomit notifications@github.com wrote:
|
Again, this is specific to Django Rest Framework's defaults. API's may only return the object ID on successful create or update. We need to handle that case.
The text was updated successfully, but these errors were encountered: