mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
HistoryService: Remove getEntryByNoteIdOrAlias
As we now have a GetNotePipe, we can easily get rid of this function. All clients can directly provide a `Note` instance and use `getEntryByNote`. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
b552fc10b6
commit
279d90dad1
3 changed files with 3 additions and 52 deletions
|
@ -95,13 +95,10 @@ export class MeController {
|
|||
@ApiNotFoundResponse({ description: notFoundDescription })
|
||||
async getHistoryEntry(
|
||||
@RequestUser() user: User,
|
||||
@Param('note') note: string,
|
||||
@Param('note', GetNotePipe) note: Note,
|
||||
): Promise<HistoryEntryDto> {
|
||||
try {
|
||||
const foundEntry = await this.historyService.getEntryByNoteIdOrAlias(
|
||||
note,
|
||||
user,
|
||||
);
|
||||
const foundEntry = await this.historyService.getEntryByNote(note, user);
|
||||
return this.historyService.toHistoryEntryDto(foundEntry);
|
||||
} catch (e) {
|
||||
if (e instanceof NotInDBError) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue