Ghost/core/client/app/adapters/setting.js
Austin Burdine 28d265c9c1 update Ember to 1.12.1/ember-data to 1.0.0-beta.18
No issue
- fixed "{{#each}}" helper in templates to use block syntax
- fixed deprecated ember.controller getter/setter function to use new syntax
- removed unnecessary pass-protect route view
2015-06-02 22:26:16 -06:00

22 lines
738 B
JavaScript

import ApplicationAdapter from 'ghost/adapters/application';
var SettingAdapter = 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});
}
});
export default SettingAdapter;