mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Merge pull request #1179 from hedgedoc/util/replaceNull
This commit is contained in:
commit
0bad4827bf
3 changed files with 5 additions and 5 deletions
|
@ -168,7 +168,7 @@ export class HistoryService {
|
||||||
identifier: entry.note.alias ? entry.note.alias : entry.note.id,
|
identifier: entry.note.alias ? entry.note.alias : entry.note.id,
|
||||||
lastVisited: entry.updatedAt,
|
lastVisited: entry.updatedAt,
|
||||||
tags: this.notesService.toTagList(entry.note),
|
tags: this.notesService.toTagList(entry.note),
|
||||||
title: entry.note.title,
|
title: entry.note.title ?? '',
|
||||||
pinStatus: entry.pinStatus,
|
pinStatus: entry.pinStatus,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,9 +352,9 @@ 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: note.title,
|
title: note.title ?? '',
|
||||||
createTime: (await this.getFirstRevision(note)).createdAt,
|
createTime: (await this.getFirstRevision(note)).createdAt,
|
||||||
description: note.description,
|
description: note.description ?? '',
|
||||||
editedBy: note.authorColors.map(
|
editedBy: note.authorColors.map(
|
||||||
(authorColor) => authorColor.user.userName,
|
(authorColor) => authorColor.user.userName,
|
||||||
),
|
),
|
||||||
|
|
|
@ -270,8 +270,8 @@ describe('Notes', () => {
|
||||||
.expect(200);
|
.expect(200);
|
||||||
expect(typeof metadata.body.id).toEqual('string');
|
expect(typeof metadata.body.id).toEqual('string');
|
||||||
expect(metadata.body.alias).toEqual('test5');
|
expect(metadata.body.alias).toEqual('test5');
|
||||||
expect(metadata.body.title).toBeNull();
|
expect(metadata.body.title).toEqual('');
|
||||||
expect(metadata.body.description).toBeNull();
|
expect(metadata.body.description).toEqual('');
|
||||||
expect(typeof metadata.body.createTime).toEqual('string');
|
expect(typeof metadata.body.createTime).toEqual('string');
|
||||||
expect(metadata.body.editedBy).toEqual([]);
|
expect(metadata.body.editedBy).toEqual([]);
|
||||||
expect(metadata.body.permissions.owner.userName).toEqual('hardcoded');
|
expect(metadata.body.permissions.owner.userName).toEqual('hardcoded');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue