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:
David Mehren 2021-08-29 21:57:35 +02:00
parent b552fc10b6
commit 279d90dad1
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 3 additions and 52 deletions

View file

@ -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) {