This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Tom Moor 7f9cba9819
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
2021-04-18 09:38:13 -07:00

25 lines
535 B
JavaScript

// @flow
import { Event } from "../models";
import presentUser from "./user";
export default function present(event: Event, isAdmin: boolean = false) {
let data = {
id: event.id,
name: event.name,
modelId: event.modelId,
actorId: event.actorId,
actorIpAddress: event.ip,
collectionId: event.collectionId,
documentId: event.documentId,
createdAt: event.createdAt,
data: event.data,
actor: presentUser(event.actor),
};
if (!isAdmin) {
delete data.actorIpAddress;
}
return data;
}