Display document views (#849)
* Display who has viewed a document in the header * Add overflow, display of WHEN last viewed Cleanup old document attributes Add firstViewedAt, lastViewedAt to API response * Cleanup * Added: API documentation for views endpoints * Include views for deleted users
This commit is contained in:
@ -148,7 +148,7 @@ router.post('documents.starred', auth(), pagination(), async ctx => {
|
||||
const user = ctx.state.user;
|
||||
const collectionIds = await user.collectionIds();
|
||||
|
||||
const views = await Star.findAll({
|
||||
const stars = await Star.findAll({
|
||||
where: {
|
||||
userId: user.id,
|
||||
},
|
||||
@ -175,7 +175,7 @@ router.post('documents.starred', auth(), pagination(), async ctx => {
|
||||
});
|
||||
|
||||
const data = await Promise.all(
|
||||
views.map(view => presentDocument(ctx, view.document))
|
||||
stars.map(star => presentDocument(ctx, star.document))
|
||||
);
|
||||
|
||||
ctx.body = {
|
||||
|
Reference in New Issue
Block a user