mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
refactor(alias): lazy-load relations
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
296d73c121
commit
d761ff7f4f
1 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ export class Alias {
|
||||||
@ManyToOne((_) => Note, (note) => note.aliases, {
|
@ManyToOne((_) => Note, (note) => note.aliases, {
|
||||||
onDelete: 'CASCADE', // This deletes the Alias, when the associated Note is deleted
|
onDelete: 'CASCADE', // This deletes the Alias, when the associated Note is deleted
|
||||||
})
|
})
|
||||||
note: Note;
|
note: Promise<Note>;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
private constructor() {}
|
private constructor() {}
|
||||||
|
@ -58,7 +58,7 @@ export class Alias {
|
||||||
const alias = new Alias();
|
const alias = new Alias();
|
||||||
alias.name = name;
|
alias.name = name;
|
||||||
alias.primary = primary;
|
alias.primary = primary;
|
||||||
alias.note = note;
|
alias.note = Promise.resolve(note);
|
||||||
return alias;
|
return alias;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue