mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
16 lines
481 B
JavaScript
16 lines
481 B
JavaScript
|
export default DS.RESTSerializer.extend({
|
||
|
serializeIntoHash: function (hash, type, record, options) {
|
||
|
// Our API expects an id on the posted object
|
||
|
options = options || {};
|
||
|
options.includeId = true;
|
||
|
|
||
|
// We have a plural root in the API
|
||
|
var root = Ember.String.pluralize(type.typeKey),
|
||
|
data = this.serialize(record, options);
|
||
|
|
||
|
// Don't ever pass uuid's
|
||
|
delete data.uuid;
|
||
|
|
||
|
hash[root] = [data];
|
||
|
}
|
||
|
});
|