mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 16:14:43 -04:00
History: Add history service and usage
Add history service to allow for CRUD operations. Use history service in controllers to: 1. Allow manipulating of history entries 2. Guaranty the correct existence of history entries Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
300b464efd
commit
e55e62c2cd
8 changed files with 173 additions and 118 deletions
|
@ -85,7 +85,7 @@ describe('Notes', () => {
|
|||
.delete('/me/history/test3')
|
||||
.expect(204);
|
||||
expect(response.body.content).toBeNull();
|
||||
const history = historyService.getUserHistory('testuser');
|
||||
const history = historyService.getEntriesByUser('testuser');
|
||||
let historyEntry: HistoryEntryDto = null;
|
||||
for (const e of history) {
|
||||
if (e.metadata.alias === noteName) {
|
||||
|
@ -106,7 +106,7 @@ describe('Notes', () => {
|
|||
.send(historyEntryUpdateDto)
|
||||
.expect(200);
|
||||
// TODO parameter is not used for now
|
||||
const history = historyService.getUserHistory('testuser');
|
||||
const history = historyService.getEntriesByUser('testuser');
|
||||
let historyEntry: HistoryEntryDto;
|
||||
for (const e of <any[]>response.body.content) {
|
||||
if ((<HistoryEntryDto>e).metadata.alias === noteName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue