mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 01:23:08 +02:00
perf(backend): reduce db query
This commit is contained in:
parent
a561b83070
commit
f4588f3907
1 changed files with 1 additions and 1 deletions
|
@ -288,7 +288,7 @@ export class NoteEntityService implements OnModuleInit {
|
|||
}, options);
|
||||
|
||||
const meId = me ? me.id : null;
|
||||
const note = typeof src === 'object' ? src : await this.notesRepository.findOneByOrFail({ id: src });
|
||||
const note = typeof src === 'object' ? src : await this.notesRepository.findOneOrFail({ where: { id: src }, relations: ['user'] });
|
||||
const host = note.userHost;
|
||||
|
||||
let text = note.text;
|
||||
|
|
Loading…
Reference in a new issue