5c9a824d53
no issue - drops the `var Foo = Ember.Thing.extend({}); export default Foo;` syntax in favour of exporting directly, eg: `export default Ember.Thing.extend({})` - discussion on this change [here](https://github.com/TryGhost/Ghost/pull/5340#issuecomment-105828423) and [here](https://github.com/TryGhost/Ghost/pull/5694#discussion-diff-37511606)
20 lines
700 B
JavaScript
20 lines
700 B
JavaScript
import ApplicationAdapter from 'ghost/adapters/application';
|
|
|
|
export default ApplicationAdapter.extend({
|
|
updateRecord: function (store, type, record) {
|
|
var data = {},
|
|
serializer = store.serializerFor(type.modelName);
|
|
|
|
// remove the fake id that we added onto the model.
|
|
delete record.id;
|
|
|
|
// use the SettingSerializer to transform the model back into
|
|
// an array of settings objects like the API expects
|
|
serializer.serializeIntoHash(data, type, record);
|
|
|
|
// use the ApplicationAdapter's buildURL method but do not
|
|
// pass in an id.
|
|
return this.ajax(this.buildURL(type.modelName), 'PUT', {data: data});
|
|
}
|
|
});
|