NotesService: Get metadata from database

Signed-off-by: David Mehren <git@herrmehren.de>
Co-authored-by: Yannick Bungers <git@innay.de>
This commit is contained in:
David Mehren 2020-10-03 11:27:15 +02:00
parent f1f57eca54
commit b349d25bd7
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -102,10 +102,10 @@ export class NotesService {
// TODO: Convert DB UUID to base64 // TODO: Convert DB UUID to base64
id: note.id, id: note.id,
alias: note.alias, alias: note.alias,
title: NoteUtils.parseTitle(note), title: note.title,
// TODO: Get actual createTime // TODO: Get actual createTime
createTime: new Date(), createTime: new Date(),
description: NoteUtils.parseDescription(note), description: note.description,
editedBy: note.authorColors.map(authorColor => authorColor.user.userName), editedBy: note.authorColors.map(authorColor => authorColor.user.userName),
// TODO: Extract into method // TODO: Extract into method
permissions: { permissions: {
@ -119,7 +119,7 @@ export class NotesService {
canEdit: noteGroupPermission.canEdit, canEdit: noteGroupPermission.canEdit,
})), })),
}, },
tags: NoteUtils.parseTags(note), tags: note.tags.map(tag => tag.name),
updateTime: (await this.getLastRevision(note)).createdAt, updateTime: (await this.getLastRevision(note)).createdAt,
// TODO: Get actual updateUser // TODO: Get actual updateUser
updateUser: { updateUser: {