refactor(session): lazy-load relations

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-12-05 21:49:29 +01:00
parent 2da6faa4b4
commit 4483d2b898
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ createConnection({
notes[i],
) as Revision;
const edit = Edit.create(author, 1, 42) as Edit;
revision.edits = [edit];
revision.edits = Promise.resolve([edit]);
notes[i].revisions = Promise.all([revision]);
notes[i].userPermissions = Promise.resolve([]);
notes[i].groupPermissions = Promise.resolve([]);

View file

@ -21,5 +21,5 @@ export class Session implements ISession {
public json = '';
@ManyToOne(() => Author, (author) => author.sessions)
author: Author;
author: Promise<Author>;
}