diff --git a/src/auth/auth-token.entity.ts b/src/auth/auth-token.entity.ts index 79cb8b20f..6a3349899 100644 --- a/src/auth/auth-token.entity.ts +++ b/src/auth/auth-token.entity.ts @@ -38,12 +38,12 @@ export class AuthToken { @Column({ nullable: true, }) - validUntil: Date; + validUntil: Date | null; @Column({ nullable: true, }) - lastUsed: Date; + lastUsed: Date | null; public static create( user: User, diff --git a/src/media/media-upload.entity.ts b/src/media/media-upload.entity.ts index 341ad52ad..ffa04146a 100644 --- a/src/media/media-upload.entity.ts +++ b/src/media/media-upload.entity.ts @@ -26,7 +26,7 @@ export class MediaUpload { @ManyToOne((_) => Note, (note) => note.mediaUploads, { nullable: true, }) - note: Note; + note: Note | null; @ManyToOne((_) => User, (user) => user.mediaUploads, { nullable: false, @@ -44,7 +44,7 @@ export class MediaUpload { @Column({ nullable: true, }) - backendData: BackendData; + backendData: BackendData | null; @CreateDateColumn() createdAt: Date; diff --git a/src/notes/note.entity.ts b/src/notes/note.entity.ts index 5e4cf0ef9..a3fda2b75 100644 --- a/src/notes/note.entity.ts +++ b/src/notes/note.entity.ts @@ -36,7 +36,7 @@ export class Note { unique: true, nullable: true, }) - alias?: string; + alias: string | null; @OneToMany( (_) => NoteGroupPermission, (groupPermission) => groupPermission.note, @@ -70,11 +70,11 @@ export class Note { @Column({ nullable: true, }) - description?: string; + description: string | null; @Column({ nullable: true, }) - title?: string; + title: string | null; @ManyToMany((_) => Tag, (tag) => tag.notes, { eager: true, cascade: true }) @JoinTable() diff --git a/src/notes/notes.service.spec.ts b/src/notes/notes.service.spec.ts index 7192b5d96..bb2d3f20e 100644 --- a/src/notes/notes.service.spec.ts +++ b/src/notes/notes.service.spec.ts @@ -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); diff --git a/src/users/identity.entity.ts b/src/users/identity.entity.ts index 462399d42..6f78714b2 100644 --- a/src/users/identity.entity.ts +++ b/src/users/identity.entity.ts @@ -39,15 +39,15 @@ export class Identity { @Column({ nullable: true, }) - providerUserId?: string; + providerUserId: string | null; @Column({ nullable: true, }) - oAuthAccessToken?: string; + oAuthAccessToken: string | null; @Column({ nullable: true, }) - passwordHash?: string; + passwordHash: string | null; } diff --git a/src/users/user.entity.ts b/src/users/user.entity.ts index c04350821..606068dc7 100644 --- a/src/users/user.entity.ts +++ b/src/users/user.entity.ts @@ -41,12 +41,12 @@ export class User { @Column({ nullable: true, }) - photo?: string; + photo: string | null; @Column({ nullable: true, }) - email?: string; + email: string | null; @OneToMany((_) => Note, (note) => note.owner) ownedNotes: Note[];