mardi 24 mars 2015

ember-data async belongsTo requests

I have a model that looks like:



export default DS.Model.extend({
ordernumber: DS.attr('string'),
allowMeasurementsFrom: DS.attr('date'),
devices: DS.hasMany('device', { async: true })
});


And when I do a request to a page that is about one order I get these requests:



GET "http://localhost:51799/orders/172a1805-185f-4946-a8c6-fc9a5ed30363".
GET "http://localhost:51799/devices/0fd27d12-fd25-412d-bcf6-6e84064bd951".
GET "http://localhost:51799/devices/a84142bd-b314-4e6e-a29f-6821fb7f32fb".
GET "http://localhost:51799/devices/3b1ed530-1cf6-42fb-90b7-f1d4886dce05".


But I expected a request with multiple ids, like it says in the docs here. Like:



GET "http://localhost:51799/devices?ids[]=3b1ed530-1cf6-42fb-90b7-f1d4886dce05&ids[]=a84142bd-b314-4e6e-a29f-6821fb7f32fb&ids[]=3b1ed530-1cf6-42fb-90b7-f1d4886dce05".




Aucun commentaire:

Enregistrer un commentaire