fix(note): fix type for owner param

To make the create method easier to use in conjunction
with the authentication framework, this commit changes the type of
the `owner` parameter from `User | undefined` to `User | null`.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-11-14 21:44:59 +01:00
parent c675dd0e9e
commit b9d3c95d2d
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
14 changed files with 69 additions and 58 deletions

View file

@ -91,7 +91,7 @@ export class NotesController {
}
this.logger.debug('Got raw markdown:\n' + text);
return await this.noteService.toNoteDto(
await this.noteService.createNote(text, undefined, user),
await this.noteService.createNote(text, user),
);
}
@ -108,7 +108,7 @@ export class NotesController {
this.logger.debug('Got raw markdown:\n' + text, 'createNamedNote');
try {
return await this.noteService.toNoteDto(
await this.noteService.createNote(text, noteAlias, user),
await this.noteService.createNote(text, user, noteAlias),
);
} catch (e) {
if (e instanceof AlreadyInDBError) {