mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
91e86bde61
refs #6105 - adds `raw` ember-data transform to handle standard JSON `count` attribute - update mirage factory to return correct `count.posts` format - rename all uses of `post_count` to `count.posts`
19 lines
563 B
JavaScript
19 lines
563 B
JavaScript
import Ember from 'ember';
|
|
import ApplicationSerializer from 'ghost/serializers/application';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
serializeIntoHash: function (hash, type, record, options) {
|
|
options = options || {};
|
|
options.includeId = true;
|
|
|
|
var root = Ember.String.pluralize(type.modelName),
|
|
data = this.serialize(record, options);
|
|
|
|
// Properties that exist on the model but we don't want sent in the payload
|
|
|
|
delete data.uuid;
|
|
delete data.count;
|
|
|
|
hash[root] = [data];
|
|
}
|
|
});
|