mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-19 01:35:18 -04:00
test(e2e): fix notes service
Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
5cdc0edfb9
commit
754e725b7f
4 changed files with 20 additions and 4 deletions
|
@ -63,6 +63,13 @@ export class NotesService {
|
|||
async getUserNotes(user: User): Promise<Note[]> {
|
||||
const notes = await this.noteRepository
|
||||
.createQueryBuilder('note')
|
||||
.leftJoinAndSelect('note.aliases', 'alias')
|
||||
.leftJoinAndSelect('note.owner', 'owner')
|
||||
.leftJoinAndSelect('note.groupPermissions', 'group_permission')
|
||||
.leftJoinAndSelect('group_permission.group', 'group')
|
||||
.leftJoinAndSelect('note.userPermissions', 'user_permission')
|
||||
.leftJoinAndSelect('user_permission.user', 'user')
|
||||
.leftJoinAndSelect('note.tags', 'tag')
|
||||
.where('note.owner = :user', { user: user.id })
|
||||
.getMany();
|
||||
if (notes === null) {
|
||||
|
@ -275,8 +282,6 @@ export class NotesService {
|
|||
//TODO: Calculate patch
|
||||
revisions.push(Revision.create(noteContent, noteContent, note) as Revision);
|
||||
note.revisions = Promise.resolve(revisions);
|
||||
note.userPermissions = Promise.resolve([]);
|
||||
note.groupPermissions = Promise.resolve([]);
|
||||
return await this.noteRepository.save(note);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue