
New ember-data serializers send data without a model key in the payload by default, so instead of what API expects: { "hook": { "id": 1, "active": true } } it would send: { "id": 1, "active": true } Because of that we need to change how hooks are serialized. Furthermore, API V2 returns just "result: true" after a successful request to change a hook, so we need to return something meaningful from the adapter's updateRecord in order to make ember-data happy.
8 lines
204 B
JavaScript
8 lines
204 B
JavaScript
import ApplicationSerializer from 'travis/serializers/application';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
serialize(snapshot, options) {
|
|
return { hook: this._super(...arguments) };
|
|
}
|
|
});
|