From 841ad8428dbdc36f7b9703d95a6bfdf0bcb880da Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sat, 24 Apr 2021 21:16:06 +0200 Subject: [PATCH] Services: Use replaceNullWithEmptyString Add the helper method replaceNullWithEmptyString to the services, where it is needed. Signed-off-by: Philip Molares --- src/history/history.service.ts | 2 +- src/notes/notes.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/history/history.service.ts b/src/history/history.service.ts index 276af8190..cdd35fed4 100644 --- a/src/history/history.service.ts +++ b/src/history/history.service.ts @@ -168,7 +168,7 @@ export class HistoryService { identifier: entry.note.alias ? entry.note.alias : entry.note.id, lastVisited: entry.updatedAt, tags: this.notesService.toTagList(entry.note), - title: entry.note.title, + title: entry.note.title ?? '', pinStatus: entry.pinStatus, }; } diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index b21dba99c..befa85f81 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -352,9 +352,9 @@ export class NotesService { // TODO: Convert DB UUID to base64 id: note.id, alias: note.alias, - title: note.title, + title: note.title ?? '', createTime: (await this.getFirstRevision(note)).createdAt, - description: note.description, + description: note.description ?? '', editedBy: note.authorColors.map( (authorColor) => authorColor.user.userName, ),