New stat retrieval and event store last visited date
This commit is contained in:
parent
f16b158c7f
commit
99989e66aa
3 changed files with 22 additions and 10 deletions
|
|
@ -1,3 +1,5 @@
|
|||
const dayjs = require('dayjs');
|
||||
|
||||
module.exports = async (req, res) => {
|
||||
const { eventId } = req.params;
|
||||
|
||||
|
|
@ -9,6 +11,10 @@ module.exports = async (req, res) => {
|
|||
id: eventId,
|
||||
...event,
|
||||
});
|
||||
|
||||
// Update last visited time
|
||||
event.visited = dayjs().unix();
|
||||
await req.datastore.upsert(event);
|
||||
} else {
|
||||
res.sendStatus(404);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue