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 5f87406809
commit 16c9d6c011
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], notes[i],
) as Revision; ) as Revision;
const edit = Edit.create(author, 1, 42) as Edit; 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].revisions = Promise.all([revision]);
notes[i].userPermissions = Promise.resolve([]); notes[i].userPermissions = Promise.resolve([]);
notes[i].groupPermissions = Promise.resolve([]); notes[i].groupPermissions = Promise.resolve([]);

View file

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