2019-10-10 14:59:35 +03:00
|
|
|
/* eslint-disable camelcase */
|
2020-02-14 12:34:01 +03:00
|
|
|
import ApplicationSerializer from './application';
|
|
|
|
import {EmbeddedRecordsMixin} from '@ember-data/serializer/rest';
|
2019-10-10 14:59:35 +03:00
|
|
|
|
2020-02-14 12:34:01 +03:00
|
|
|
export default ApplicationSerializer.extend(EmbeddedRecordsMixin, {
|
2019-11-28 14:30:21 +03:00
|
|
|
attrs: {
|
2020-02-14 12:34:01 +03:00
|
|
|
createdAtUTC: {key: 'created_at'},
|
2020-12-10 14:38:38 +03:00
|
|
|
labels: {embedded: 'always'},
|
|
|
|
emailRecipients: {embedded: 'always'}
|
2019-11-28 14:30:21 +03:00
|
|
|
},
|
|
|
|
|
2019-10-10 14:59:35 +03:00
|
|
|
serialize(/*snapshot, options*/) {
|
|
|
|
let json = this._super(...arguments);
|
|
|
|
|
|
|
|
// Properties that exist on the model but we don't want sent in the payload
|
|
|
|
delete json.stripe;
|
2020-02-27 15:56:26 +03:00
|
|
|
delete json.geolocation;
|
2020-12-16 16:41:45 +03:00
|
|
|
delete json.email_recipients;
|
|
|
|
|
2019-10-10 14:59:35 +03:00
|
|
|
// Normalize properties
|
|
|
|
json.name = json.name || '';
|
|
|
|
json.note = json.note || '';
|
2020-12-16 16:41:45 +03:00
|
|
|
|
2019-10-10 14:59:35 +03:00
|
|
|
return json;
|
|
|
|
}
|
|
|
|
});
|