0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/serializers/post.js

18 lines
509 B
JavaScript
Raw Normal View History

import ApplicationSerializer from 'ghost/serializers/application';
var PostSerializer = ApplicationSerializer.extend({
serializeHasMany: function (record, json, relationship) {
var key = relationship.key;
if (key === 'tags') {
json[key] = Ember.get(record, key).map(function (tag) {
return tag.serialize({ includeId: true });
});
} else {
this._super.apply(this, arguments);
}
}
});
export default PostSerializer;