From 15a1a138ee4a5daec411c1fcdbecf501a47d8d15 Mon Sep 17 00:00:00 2001 From: Yannick Bungers Date: Mon, 22 Feb 2021 22:31:02 +0100 Subject: [PATCH] Remove unused getNoteContentByIdOrAlias Signed-off-by: Yannick Bungers --- src/notes/notes.service.spec.ts | 16 ---------------- src/notes/notes.service.ts | 11 ----------- 2 files changed, 27 deletions(-) diff --git a/src/notes/notes.service.spec.ts b/src/notes/notes.service.spec.ts index 9bc4c7ad8..78e730c4b 100644 --- a/src/notes/notes.service.spec.ts +++ b/src/notes/notes.service.spec.ts @@ -575,22 +575,6 @@ describe('NotesService', () => { }); }); - describe('getNoteContentByIdOrAlias', () => { - it('works', async () => { - const content = 'testContent'; - jest - .spyOn(noteRepo, 'save') - .mockImplementation(async (note: Note): Promise => note); - const newNote = await service.createNote(content); - const revisions = await newNote.revisions; - jest.spyOn(noteRepo, 'findOne').mockResolvedValueOnce(newNote); - jest.spyOn(revisionRepo, 'findOne').mockResolvedValueOnce(revisions[0]); - service.getNoteContentByIdOrAlias('noteThatExists').then((result) => { - expect(result).toEqual(content); - }); - }); - }); - describe('toTagList', () => { it('works', async () => { const note = {} as Note; diff --git a/src/notes/notes.service.ts b/src/notes/notes.service.ts index 8c705b36b..e17fb2ca1 100644 --- a/src/notes/notes.service.ts +++ b/src/notes/notes.service.ts @@ -266,17 +266,6 @@ export class NotesService { return await this.noteRepository.save(note); } - /** - * @async - * Get the current content of the note by either their id or alias. - * @param {string} noteIdOrAlias - the notes id or alias - * @return {string} the content of the note - */ - async getNoteContentByIdOrAlias(noteIdOrAlias: string): Promise { - const note = await this.getNoteByIdOrAlias(noteIdOrAlias); - return this.getNoteContentByNote(note); - } - /** * @async * Calculate the updateUser (for the NoteDto) for a Note.