mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-16 23:23:56 +00:00
Remove unused getNoteContentByIdOrAlias
Signed-off-by: Yannick Bungers <git@innay.de>
This commit is contained in:
parent
8873ac316a
commit
8ec756afb4
2 changed files with 0 additions and 27 deletions
|
@ -575,22 +575,6 @@ describe('NotesService', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('getNoteContentByIdOrAlias', () => {
|
||||
it('works', async () => {
|
||||
const content = 'testContent';
|
||||
jest
|
||||
.spyOn(noteRepo, 'save')
|
||||
.mockImplementation(async (note: Note): Promise<Note> => 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;
|
||||
|
|
|
@ -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<string> {
|
||||
const note = await this.getNoteByIdOrAlias(noteIdOrAlias);
|
||||
return this.getNoteContentByNote(note);
|
||||
}
|
||||
|
||||
/**
|
||||
* @async
|
||||
* Calculate the updateUser (for the NoteDto) for a Note.
|
||||
|
|
Loading…
Reference in a new issue