mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 14:44:43 -04:00
Fix nullable property types in Note DTOs
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
73997d4693
commit
6471ba92ef
3 changed files with 6 additions and 8 deletions
|
@ -337,7 +337,7 @@ export class NotesService {
|
|||
*/
|
||||
toNotePermissionsDto(note: Note): NotePermissionsDto {
|
||||
return {
|
||||
owner: note.owner ? this.usersService.toUserDto(note.owner) : undefined,
|
||||
owner: note.owner ? this.usersService.toUserDto(note.owner) : null,
|
||||
sharedToUsers: note.userPermissions.map((noteUserPermission) => ({
|
||||
user: this.usersService.toUserDto(noteUserPermission.user),
|
||||
canEdit: noteUserPermission.canEdit,
|
||||
|
@ -360,7 +360,7 @@ export class NotesService {
|
|||
return {
|
||||
// TODO: Convert DB UUID to base64
|
||||
id: note.id,
|
||||
alias: note.alias ?? undefined,
|
||||
alias: note.alias ?? null,
|
||||
title: note.title ?? '',
|
||||
createTime: (await this.getFirstRevision(note)).createdAt,
|
||||
description: note.description ?? '',
|
||||
|
@ -370,9 +370,7 @@ export class NotesService {
|
|||
permissions: this.toNotePermissionsDto(note),
|
||||
tags: this.toTagList(note),
|
||||
updateTime: (await this.getLatestRevision(note)).createdAt,
|
||||
updateUser: updateUser
|
||||
? this.usersService.toUserDto(updateUser)
|
||||
: undefined,
|
||||
updateUser: updateUser ? this.usersService.toUserDto(updateUser) : null,
|
||||
viewCount: note.viewCount,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue