fix: return full inbox on user-v3-api (#12146)

* fix inbox on user-v3-api + test

* add @benkelaar suggestions
This commit is contained in:
negue
2020-05-02 21:48:16 +02:00
committed by GitHub
parent 26767f598b
commit 1c94c1a968
4 changed files with 28 additions and 3 deletions

View File

@@ -497,7 +497,9 @@ schema.methods.toJSONWithInbox = async function userToJSONWithInbox () {
const toJSON = user.toJSON();
if (toJSON.inbox) {
toJSON.inbox.messages = await inboxLib.getUserInbox(user, { asArray: false });
toJSON.inbox.messages = await inboxLib.getUserInbox(user, {
asArray: false,
});
}
return toJSON;