mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 Fixed response for members API update endpoint
closes https://github.com/TryGhost/members.js/issues/87
- The `update` method in members-api package was edited to return Model object instead of JSON directly [here](a28bcc5b2a
)
- This caused the update member API on member endpoint to return partial response only as most properties couldn't be fetched
- Fix updates the middleware to correctly call `toJSON` before formatting response
This commit is contained in:
parent
91d1417df2
commit
297b63edce
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ const updateMemberData = async function (req, res) {
|
|||
const member = await membersService.ssr.getMemberDataFromSession(req, res);
|
||||
if (member) {
|
||||
const updatedMember = await membersService.api.members.update(data, {id: member.id});
|
||||
res.json(formattedMemberResponse(updatedMember));
|
||||
res.json(formattedMemberResponse(updatedMember.toJSON()));
|
||||
} else {
|
||||
res.json(null);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue