mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 02:06:29 -05:00
NotesService: toNotePermissionsDto does not need to be async
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
def4ef145e
commit
bfa5f0dfc6
2 changed files with 3 additions and 4 deletions
|
@ -221,7 +221,7 @@ export class NotesController {
|
|||
if (!this.permissionsService.isOwner(req.user, note)) {
|
||||
throw new UnauthorizedException('Updating note denied!');
|
||||
}
|
||||
return await this.noteService.toNotePermissionsDto(
|
||||
return this.noteService.toNotePermissionsDto(
|
||||
this.noteService.updateNotePermissions(note, updateDto),
|
||||
);
|
||||
} catch (e) {
|
||||
|
|
|
@ -295,12 +295,11 @@ export class NotesService {
|
|||
}
|
||||
|
||||
/**
|
||||
* @async
|
||||
* Build NotePermissionsDto from a note.
|
||||
* @param {Note} note - the note to use
|
||||
* @return {NotePermissionsDto} the built NotePermissionDto
|
||||
*/
|
||||
async toNotePermissionsDto(note: Note): Promise<NotePermissionsDto> {
|
||||
toNotePermissionsDto(note: Note): Promise<NotePermissionsDto> {
|
||||
return {
|
||||
owner: this.usersService.toUserDto(note.owner),
|
||||
sharedToUsers: note.userPermissions.map((noteUserPermission) => ({
|
||||
|
@ -331,7 +330,7 @@ export class NotesService {
|
|||
editedBy: note.authorColors.map(
|
||||
(authorColor) => authorColor.user.userName,
|
||||
),
|
||||
permissions: await this.toNotePermissionsDto(note),
|
||||
permissions: this.toNotePermissionsDto(note),
|
||||
tags: this.toTagList(note),
|
||||
updateTime: (await this.getLatestRevision(note)).createdAt,
|
||||
updateUser: this.usersService.toUserDto(
|
||||
|
|
Loading…
Reference in a new issue