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:
parent
0103ef8e3c
commit
5a4976f669
1 changed files with 11 additions and 0 deletions
|
@ -5,5 +5,16 @@ export default ApplicationSerializer.extend({
|
|||
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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue