HistoryService: toHistoryEntryDto does not need to be async

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-24 21:19:48 +01:00
parent d8d105ed75
commit b37b2d1047
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
3 changed files with 5 additions and 7 deletions

View file

@ -248,7 +248,7 @@ describe('HistoryService', () => {
const historyEntry = HistoryEntry.create(user, note);
historyEntry.pinStatus = true;
jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(note);
const historyEntryDto = await service.toHistoryEntryDto(historyEntry);
const historyEntryDto = service.toHistoryEntryDto(historyEntry);
expect(historyEntryDto.pinStatus).toEqual(true);
expect(historyEntryDto.identifier).toEqual(alias);
expect(historyEntryDto.tags).toEqual(tags);
@ -271,7 +271,7 @@ describe('HistoryService', () => {
const historyEntry = HistoryEntry.create(user, note);
historyEntry.pinStatus = true;
jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(note);
const historyEntryDto = await service.toHistoryEntryDto(historyEntry);
const historyEntryDto = service.toHistoryEntryDto(historyEntry);
expect(historyEntryDto.pinStatus).toEqual(true);
expect(historyEntryDto.identifier).toEqual(id);
expect(historyEntryDto.tags).toEqual(tags);

View file

@ -93,7 +93,7 @@ export class HistoryService {
return;
}
async toHistoryEntryDto(entry: HistoryEntry): Promise<HistoryEntryDto> {
toHistoryEntryDto(entry: HistoryEntry): HistoryEntryDto {
return {
identifier: entry.note.alias ? entry.note.alias : entry.note.id,
lastVisited: entry.updatedAt,