AuthorshipEntity: Adjust to DB schema

This commit replaces the user property with a author property,
in accordance with the DB schema updated in 0d6c3002.

It also adjusts the NoteService accordingly.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-05-19 22:12:25 +02:00
parent 8040f47d00
commit 3d07c5e443
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 25 additions and 11 deletions

View file

@ -310,7 +310,7 @@ export class NotesService {
// the user of that Authorship is the updateUser
return lastRevision.authorships.sort(
(a, b) => b.updatedAt.getTime() - a.updatedAt.getTime(),
)[0].user;
)[0].author.user;
}
// If there are no Authorships, the owner is the updateUser
return note.owner;