0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

🐛 Fixed missing member email on unsubscribe page

no refs

- The `update` method in members-api package was edited to return Model object instead of JSON directly - TryGhost/Members@a28bcc5
- This unsubscribe handler was returning the raw member object returned from `update` method, which is now a model object and not able to access `member.email`
- Fix updates the unsubscribe request handler to return the member JSON again
This commit is contained in:
Rish 2020-09-02 12:02:34 +05:30
parent 96c18edc82
commit 696e60dd51

View file

@ -177,7 +177,8 @@ async function handleUnsubscribeRequest(req) {
}
try {
return await membersService.api.members.update({subscribed: false}, {id: member.id});
const memberModel = await membersService.api.members.update({subscribed: false}, {id: member.id});
return memberModel.toJSON();
} catch (err) {
throw new errors.InternalServerError({
message: 'Failed to unsubscribe member'