Correctly type nullable columns

TypeORM columns with `nullable: true` can be `null` at runtime.
This commit ensures that the types of the corresponding properties reflect that.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-04-29 16:54:57 +02:00
parent d63f581a42
commit 22702b3390
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
6 changed files with 14 additions and 14 deletions

View file

@ -153,7 +153,7 @@ describe('NotesService', () => {
expect(newNote.groupPermissions).toHaveLength(0);
expect(newNote.tags).toHaveLength(0);
expect(newNote.owner).toBeUndefined();
expect(newNote.alias).toBeUndefined();
expect(newNote.alias).toBeNull();
});
it('without alias, with owner', async () => {
const newNote = await service.createNote(content, undefined, user);
@ -166,7 +166,7 @@ describe('NotesService', () => {
expect(newNote.groupPermissions).toHaveLength(0);
expect(newNote.tags).toHaveLength(0);
expect(newNote.owner).toEqual(user);
expect(newNote.alias).toBeUndefined();
expect(newNote.alias).toBeNull();
});
it('with alias, without owner', async () => {
const newNote = await service.createNote(content, alias);