Skip to content

Send query params with DS.find() #123

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

Closed
TimothyKrell opened this issue Aug 19, 2014 · 2 comments
Closed

Send query params with DS.find() #123

TimothyKrell opened this issue Aug 19, 2014 · 2 comments
Assignees
Milestone

Comments

@TimothyKrell
Copy link
Contributor

I'm finding the need to send query params requesting a single resource. With the API I'm working with, I can ask it to send relationships in the response with ?relationships=1. I can do this with DS.findAll() but not DS.find().

I'm thinking it would look something like

DS.find('book', 1, { relationships: 1 }, { bypassCache: true });

Does this seem like a good feature? It would potentially break the current API.

@TimothyKrell
Copy link
Contributor Author

OK. Now I feel stupid. Adding { params: { relationships: 1 } } to the options parameter worked. That's good enough for me. It would be nice if this were documented somewhere a little more clearly. I can do a pull request to the DS.find() doc if that's where you think it should go.

@jmdobry
Copy link
Member

jmdobry commented Aug 19, 2014

I'll go ahead and fix it. It needs to be added in several places.

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

No branches or pull requests

2 participants