mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-27 03:58:02 -05:00
NotesService: rename getLastRevision
to getLatestRevision
This fixes an inconsistency with `RevisionsService` Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
432ebe1386
commit
32feb5ee10
2 changed files with 4 additions and 4 deletions
|
@ -97,10 +97,10 @@ export class NotesService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCurrentContent(note: Note) {
|
async getCurrentContent(note: Note) {
|
||||||
return (await this.getLastRevision(note)).content;
|
return (await this.getLatestRevision(note)).content;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLastRevision(note: Note): Promise<Revision> {
|
async getLatestRevision(note: Note): Promise<Revision> {
|
||||||
return this.revisionsService.getLatestRevision(note.id);
|
return this.revisionsService.getLatestRevision(note.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ export class NotesService {
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
tags: note.tags.map((tag) => tag.name),
|
tags: note.tags.map((tag) => tag.name),
|
||||||
updateTime: (await this.getLastRevision(note)).createdAt,
|
updateTime: (await this.getLatestRevision(note)).createdAt,
|
||||||
// TODO: Get actual updateUser
|
// TODO: Get actual updateUser
|
||||||
updateUser: {
|
updateUser: {
|
||||||
displayName: 'Hardcoded User',
|
displayName: 'Hardcoded User',
|
||||||
|
|
|
@ -167,7 +167,7 @@ describe('Notes', () => {
|
||||||
|
|
||||||
it(`GET /notes/{note}/revisions/{revision-id}`, async () => {
|
it(`GET /notes/{note}/revisions/{revision-id}`, async () => {
|
||||||
const note = await notesService.createNote('This is a test note.', 'test8');
|
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())
|
const response = await request(app.getHttpServer())
|
||||||
.get('/notes/test8/revisions/' + revision.id)
|
.get('/notes/test8/revisions/' + revision.id)
|
||||||
.expect('Content-Type', /json/)
|
.expect('Content-Type', /json/)
|
||||||
|
|
Loading…
Reference in a new issue