From 32feb5ee10c19c87c2d55efe72da06254eca2d93 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sun, 10 Jan 2021 18:20:28 +0100 Subject: [PATCH] NotesService: rename `getLastRevision` to `getLatestRevision` This fixes an inconsistency with `RevisionsService` Signed-off-by: David Mehren --- src/notes/notes.service.ts | 6 +++--- test/public-api/notes.e2e-spec.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index f1718aa2b..79c6df6ca 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -97,10 +97,10 @@ export class NotesService { } async getCurrentContent(note: Note) { - return (await this.getLastRevision(note)).content; + return (await this.getLatestRevision(note)).content; } - async getLastRevision(note: Note): Promise { + async getLatestRevision(note: Note): Promise { return this.revisionsService.getLatestRevision(note.id); } @@ -129,7 +129,7 @@ export class NotesService { })), }, tags: note.tags.map((tag) => tag.name), - updateTime: (await this.getLastRevision(note)).createdAt, + updateTime: (await this.getLatestRevision(note)).createdAt, // TODO: Get actual updateUser updateUser: { displayName: 'Hardcoded User', diff --git a/test/public-api/notes.e2e-spec.ts b/test/public-api/notes.e2e-spec.ts index 2fcf1fe70..1ebeba039 100644 --- a/test/public-api/notes.e2e-spec.ts +++ b/test/public-api/notes.e2e-spec.ts @@ -167,7 +167,7 @@ describe('Notes', () => { it(`GET /notes/{note}/revisions/{revision-id}`, async () => { const note = await notesService.createNote('This is a test note.', 'test8'); - const revision = await notesService.getLastRevision(note); + const revision = await notesService.getLatestRevision(note); const response = await request(app.getHttpServer()) .get('/notes/test8/revisions/' + revision.id) .expect('Content-Type', /json/)