mercredi 8 juillet 2015

Ember JS, Patch Record REST Adapter

Is there a way with Ember JS to use the PATCH verb in order to partially update a record on the server (instead of PUT which will override the whole record).

Creating a record

Using POST which is all good.

var car = store.createRecord('car', {
  make: 'Honda',
  model: 'Civic'
});
car.save(); // => POST to '/cars'

Modifying a record

Always using PUT which is not ideal.

car.set('model', 'Accord')
car.save(); // => PUT to '/cars/{id}'

I would like to have the control over the HTTP verb used for saving.




Aucun commentaire:

Enregistrer un commentaire