lundi 24 octobre 2016

ember data pluralizing nouns when fetching data from REST

I am having a Dynamic routing page at http://localhost:4200/organizer/{organizer-id} which fetches data from a RESTful JSONAPI adapter.

organizer.js:

export default Ember.Route.extend({
  model: function(params) {
    return this.get('store').findRecord('organizer', params.organizer_id);
  }
});

ember data plurarizes organizer into organizers when fetching data from the REST adapter. From the docs it seems to be the intended behavior, however from a RESTful perspective, is it correct?

/organizers should give me a list of organizers?

/organizer/{organizer-id} should give me 1 organizer?

Expected:

http://localhost:9300/apis/organizer/organizer-b547259c-ece2-4d58-8d4b-13a2dd448e1a

Actual:

http://localhost:9300/apis/organizers/organizer-b547259c-ece2-4d58-8d4b-13a2dd448e1a




Aucun commentaire:

Enregistrer un commentaire