mardi 8 mars 2016

ember adapter url - find by id pattern

I've got an api with specific url structure. How do I pass the ID to the url string using an adapter or something? There's only one model, patient but I need to query each of these items plus more. I've seen where you can place the id at the end of the url, but I'm not sure how to build an additional string to a find query. Thanks!

GET: /api/v1/me/patients/{id}

GET: /api/v1/me/patients/{patient_id}/public_number

This is what the model has in it:

/models/patient.js

export default DS.Model.extend({
    public_number:  DS.attr('string')
});




Aucun commentaire:

Enregistrer un commentaire