refactor(tag): lazy-load relations

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-12-05 19:06:05 +01:00
parent 3c0c11e3d4
commit f164e84081
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 4 additions and 4 deletions

View file

@ -657,7 +657,7 @@ describe('NotesService', () => {
{
id: 1,
name: 'testTag',
notes: [note],
notes: Promise.resolve([note]),
},
]);
const tagList = await service.toTagList(note);
@ -764,7 +764,7 @@ describe('NotesService', () => {
{
id: 1,
name: 'testTag',
notes: [note],
notes: Promise.resolve([note]),
},
]);
note.viewCount = 1337;
@ -866,7 +866,7 @@ describe('NotesService', () => {
{
id: 1,
name: 'testTag',
notes: [note],
notes: Promise.resolve([note]),
},
]);
note.viewCount = 1337;

View file

@ -18,5 +18,5 @@ export class Tag {
name: string;
@ManyToMany((_) => Note, (note) => note.tags)
notes: Note[];
notes: Promise<Note[]>;
}