Skip to content

Commit dc37e5d

Browse files
glpatcernYukaii
andcommitted
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>
1 parent c9399f3 commit dc37e5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/note/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,15 @@ const updateNote = async (req, res) => {
292292
title: Note.parseNoteTitle(content),
293293
content: content,
294294
lastchangeAt: now,
295-
authorship: req.isAuthenticated() ? [
295+
authorship: [
296296
[
297-
req.user.id,
297+
req.isAuthenticated() ? req.user.id : null,
298298
0,
299299
content.length,
300300
now,
301301
now
302302
]
303-
] : []
303+
]
304304
})
305305

306306
if (!updated) {

0 commit comments

Comments
 (0)