Better update of the authorship of anonymous users

Co-authored-by: Yukai Huang <yukaihuangtw@gmail.com>
Signed-off-by: Giuseppe Lo Presti <giuseppe.lopresti@cern.ch>
This commit is contained in:
Giuseppe Lo Presti 2021-03-18 08:56:19 +01:00
parent c9399f33d1
commit dc37e5df63
1 changed files with 3 additions and 3 deletions

View File

@ -292,15 +292,15 @@ const updateNote = async (req, res) => {
title: Note.parseNoteTitle(content), title: Note.parseNoteTitle(content),
content: content, content: content,
lastchangeAt: now, lastchangeAt: now,
authorship: req.isAuthenticated() ? [ authorship: [
[ [
req.user.id, req.isAuthenticated() ? req.user.id : null,
0, 0,
content.length, content.length,
now, now,
now now
] ]
] : [] ]
}) })
if (!updated) { if (!updated) {