jeudi 24 septembre 2015

Ember - GET Request to nested API Endpoint

I'm trying to find a list of all individuals in a particular group (let's say group 349) with a GET /groups/349/individuals request to the API (I'm using the JSONAPIAdapter). I'm assuming I would need to find the specific group first and then find the list of all individuals in that group second.

I originally thought to use something like:

this.store.findRecord('group', 349).then(function(members) {
    ...
})

But I'm not sure what to put inside the function. I'm also not sure if this is the correct approach or if I would need to do a this.store.findAll('individual') after finding the specific group I was searching for. I have looked throught the Ember documentation but have not found anything specific for my particular case.

If anyone could point me in the right direction it would be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire