perf(backend): reduce db query

This commit is contained in:
syuilo 2023-04-07 10:07:41 +09:00
parent a561b83070
commit f4588f3907

View file

@ -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;