diff --git a/src/history/history-entry.dto.ts b/src/history/history-entry.dto.ts index 12d51e416..eeaf24d75 100644 --- a/src/history/history-entry.dto.ts +++ b/src/history/history-entry.dto.ts @@ -29,7 +29,7 @@ export class HistoryEntryDto { */ @IsDate() @ApiProperty() - lastVisited: Date; + lastVisitedAt: Date; @IsArray() @IsString({ each: true }) diff --git a/src/history/history.service.ts b/src/history/history.service.ts index c4081d3bc..3cdea5269 100644 --- a/src/history/history.service.ts +++ b/src/history/history.service.ts @@ -189,7 +189,7 @@ export class HistoryService { async toHistoryEntryDto(entry: HistoryEntry): Promise { return { identifier: await getIdentifier(entry), - lastVisited: entry.updatedAt, + lastVisitedAt: entry.updatedAt, tags: await this.notesService.toTagList(entry.note), title: entry.note.title ?? '', pinStatus: entry.pinStatus, diff --git a/test/private-api/history.e2e-spec.ts b/test/private-api/history.e2e-spec.ts index 0da6cf547..f8735bd77 100644 --- a/test/private-api/history.e2e-spec.ts +++ b/test/private-api/history.e2e-spec.ts @@ -79,8 +79,8 @@ describe('History', () => { expect(response.body[0].title).toEqual(entryDto.title); expect(response.body[0].tags).toEqual(entryDto.tags); expect(response.body[0].pinStatus).toEqual(entryDto.pinStatus); - expect(response.body[0].lastVisited).toEqual( - entryDto.lastVisited.toISOString(), + expect(response.body[0].lastVisitedAt).toEqual( + entryDto.lastVisitedAt.toISOString(), ); }); @@ -218,7 +218,7 @@ describe('History', () => { expect(userEntryDto.title).toEqual(entryDto.title); expect(userEntryDto.tags).toEqual(entryDto.tags); expect(userEntryDto.pinStatus).toEqual(entryDto.pinStatus); - expect(userEntryDto.lastVisited).toEqual(entryDto.lastVisited); + expect(userEntryDto.lastVisitedAt).toEqual(entryDto.lastVisitedAt); }); afterAll(async () => { diff --git a/test/public-api/me.e2e-spec.ts b/test/public-api/me.e2e-spec.ts index 3e947933b..e2d42fcb1 100644 --- a/test/public-api/me.e2e-spec.ts +++ b/test/public-api/me.e2e-spec.ts @@ -59,8 +59,8 @@ describe('Me', () => { expect(historyEntry.title).toEqual(historyDto.title); expect(historyEntry.tags).toEqual(historyDto.tags); expect(historyEntry.pinStatus).toEqual(historyDto.pinStatus); - expect(historyEntry.lastVisited).toEqual( - historyDto.lastVisited.toISOString(), + expect(historyEntry.lastVisitedAt).toEqual( + historyDto.lastVisitedAt.toISOString(), ); } }); @@ -83,8 +83,8 @@ describe('Me', () => { expect(historyEntry.title).toEqual(historyEntryDto.title); expect(historyEntry.tags).toEqual(historyEntryDto.tags); expect(historyEntry.pinStatus).toEqual(historyEntryDto.pinStatus); - expect(historyEntry.lastVisited).toEqual( - historyEntryDto.lastVisited.toISOString(), + expect(historyEntry.lastVisitedAt).toEqual( + historyEntryDto.lastVisitedAt.toISOString(), ); }); it('fails with a non-existing note', async () => {