0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 Fixed error when creating subscribers via the admin area

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
This commit is contained in:
Kevin Ansfield 2019-03-06 09:19:39 +00:00
parent 0103ef8e3c
commit 5a4976f669

View file

@ -5,5 +5,16 @@ export default ApplicationSerializer.extend({
unsubscribedAtUTC: {key: 'unsubscribed_at'}, unsubscribedAtUTC: {key: 'unsubscribed_at'},
createdAtUTC: {key: 'created_at'}, createdAtUTC: {key: 'created_at'},
updatedAtUTC: {key: 'updated_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;
} }
}); });