mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
601e9dd2aa
refs https://github.com/TryGhost/Ghost/issues/7494 - remove `uuid` attrs from all models except Post - remove uuids from mirage factories and fixtures - add a workaround for tags where the selectize-based tags input on the PSM relies on a unique identifier for each tag which doesn't get sent back to the server when saving (fixes the broken tags input caused by uuid removal in https://github.com/TryGhost/Ghost/pull/7495)
26 lines
694 B
JavaScript
26 lines
694 B
JavaScript
/* eslint-disable camelcase */
|
|
import Ember from 'ember';
|
|
import ApplicationSerializer from 'ghost-admin/serializers/application';
|
|
|
|
const {String: {pluralize}} = Ember;
|
|
|
|
export default ApplicationSerializer.extend({
|
|
attrs: {
|
|
createdAtUTC: {key: 'created_at'},
|
|
updatedAtUTC: {key: 'updated_at'}
|
|
},
|
|
|
|
serializeIntoHash(hash, type, record, options) {
|
|
options = options || {};
|
|
options.includeId = true;
|
|
|
|
let root = pluralize(type.modelName);
|
|
let data = this.serialize(record, options);
|
|
|
|
// Properties that exist on the model but we don't want sent in the payload
|
|
|
|
delete data.count;
|
|
|
|
hash[root] = [data];
|
|
}
|
|
});
|