mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
🐛 Fixed unable to delete member when stripe is connected
closes https://github.com/TryGhost/Ghost/issues/12150 - The `destroy` method on members-api method was called incorrectly with not enough params - It expects both `data` and `options` passed down [here](https://github.com/TryGhost/Members/blob/master/packages/members-api/lib/users.js#L14) - Missing `options` in method call throws error as we read `cancelStripeSubscriptions` property on options if stripe is connected - Fix passes both data and options to the destroy method
This commit is contained in:
parent
441d345759
commit
87e8298ca7
1 changed files with 8 additions and 7 deletions
|
@ -385,14 +385,15 @@ module.exports = {
|
|||
frame.options.require = true;
|
||||
frame.options.cancelStripeSubscriptions = frame.options.cancel;
|
||||
|
||||
await Promise.resolve(membersService.api.members.destroy(frame.options))
|
||||
.catch(models.Member.NotFoundError, () => {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.resource.resourceNotFound', {
|
||||
resource: 'Member'
|
||||
})
|
||||
});
|
||||
await Promise.resolve(membersService.api.members.destroy({
|
||||
id: frame.options.id
|
||||
}, frame.options)).catch(models.Member.NotFoundError, () => {
|
||||
throw new errors.NotFoundError({
|
||||
message: i18n.t('errors.api.resource.resourceNotFound', {
|
||||
resource: 'Member'
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue