perf(backend): reduce db query
This commit is contained in:
parent
a561b83070
commit
f4588f3907
@ -288,7 +288,7 @@ export class NoteEntityService implements OnModuleInit {
|
|||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
const meId = me ? me.id : null;
|
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;
|
const host = note.userHost;
|
||||||
|
|
||||||
let text = note.text;
|
let text = note.text;
|
||||||
|
Loading…
Reference in New Issue
Block a user