mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
5a4976f669
refs https://github.com/TryGhost/Ghost/issues/10569 - updates the Subscriber serialiser to strip the `status` property from the API request when saving if it's falsy
21 lines
500 B
JavaScript
21 lines
500 B
JavaScript
import ApplicationSerializer from 'ghost-admin/serializers/application';
|
|
|
|
export default ApplicationSerializer.extend({
|
|
attrs: {
|
|
unsubscribedAtUTC: {key: 'unsubscribed_at'},
|
|
createdAtUTC: {key: 'created_at'},
|
|
updatedAtUTC: {key: 'updated_at'}
|
|
},
|
|
|
|
serialize() {
|
|
let json = this._super(...arguments);
|
|
|
|
// the API can't handle `status` being `null`
|
|
if (!json.status) {
|
|
delete json.status;
|
|
}
|
|
|
|
return json;
|
|
}
|
|
});
|