fix: Various fixes for unread tracking

This commit is contained in:
Tom Moor
2020-09-20 23:37:09 -07:00
parent d487da8f15
commit 26b9566b96
7 changed files with 49 additions and 33 deletions

View File

@ -283,7 +283,11 @@ router.post("documents.viewed", auth(), pagination(), async (ctx) => {
limit: ctx.state.pagination.limit,
});
const documents = views.map((view) => view.document);
const documents = views.map((view) => {
const document = view.document;
document.views = [view];
return document;
});
const data = await Promise.all(
documents.map((document) => presentDocument(document))
);