mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
NotesService: Let createNote
create an actual Note
and introduce createNoteDto
to create & convert in one step.
It might be handy to have access to the original `Note` after creating one, so the creation and conversion to a `NoteDto` is now split. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
446d6dec06
commit
bc1c8448df
2 changed files with 13 additions and 9 deletions
|
@ -39,7 +39,7 @@ export class NotesController {
|
|||
let bodyText: string = await getRawBody(req, 'utf-8');
|
||||
bodyText = bodyText.trim();
|
||||
this.logger.debug('Got raw markdown:\n' + bodyText);
|
||||
return this.noteService.createNote(bodyText);
|
||||
return this.noteService.createNoteDto(bodyText);
|
||||
} else {
|
||||
// TODO: Better error message
|
||||
throw new BadRequestException('Invalid body');
|
||||
|
@ -62,7 +62,7 @@ export class NotesController {
|
|||
let bodyText: string = await getRawBody(req, 'utf-8');
|
||||
bodyText = bodyText.trim();
|
||||
this.logger.debug('Got raw markdown:\n' + bodyText);
|
||||
return this.noteService.createNote(bodyText, noteAlias);
|
||||
return this.noteService.createNoteDto(bodyText, noteAlias);
|
||||
} else {
|
||||
// TODO: Better error message
|
||||
throw new BadRequestException('Invalid body');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue