0
Fork 0
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:
Rish 2020-08-24 13:38:06 +05:30
parent 91d1417df2
commit 297b63edce

View file

@ -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);
}