feat: Record share link last accessed time (#2047)
* chore: Migrations * chore: Add recording of share link views * feat: Add display of share link accessed date in admin * translations * test * translations, admin pagination
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
import { Share } from "../models";
|
||||
import { presentUser } from ".";
|
||||
|
||||
export default function present(share: Share) {
|
||||
return {
|
||||
export default function present(share: Share, isAdmin: boolean = false) {
|
||||
let data = {
|
||||
id: share.id,
|
||||
documentId: share.documentId,
|
||||
documentTitle: share.document.title,
|
||||
@@ -11,7 +11,14 @@ export default function present(share: Share) {
|
||||
published: share.published,
|
||||
url: `${share.team.url}/share/${share.id}`,
|
||||
createdBy: presentUser(share.user),
|
||||
lastAccessedAt: share.lastAccessedAt,
|
||||
createdAt: share.createdAt,
|
||||
updatedAt: share.updatedAt,
|
||||
};
|
||||
|
||||
if (!isAdmin) {
|
||||
delete data.lastAccessedAt;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user