SpoonX / aurelia-api

A simple convenience wrapper around aurelia-fetch-client
http://aurelia-api.spoonx.org
MIT License
72 stars 21 forks source link

the getRequestPath does not allow something like resource/id?option=foo #149

Closed ricbermo closed 8 years ago

ricbermo commented 8 years ago

I've been trying to send the access_token in the url without success. Checking and the source code I could see the getRequestPath function does not transforms properly the criteria.

Going back to my example, sending query parameters and and ID to fetch a resource is not possible.

doing something like apiEndpoint.find('users', 1, {token: asdasdads}); only returns users/1; the access option is lost.

doktordirk commented 8 years ago

usually one can do {id:1, token:rytr} instead. can.t you?

doktordirk commented 8 years ago

ps: criteria is for the uri and options for fetch options eg headers

ricbermo commented 8 years ago

{id:1, token:rytr} will generate ?id=....&token=.....

doktordirk commented 8 years ago

yes, that's what i meant. your server doesn't accept that?

ricbermo commented 8 years ago

well it's a restful api.

doktordirk commented 8 years ago

well, i think there would be two options. use find(path/id, criteria) or we add a findOne(path, id, criteria)