[backend] Improve renote status aggregate query

This commit is contained in:
Laura Hausmann 2023-11-24 21:14:17 +01:00
parent 8a6101059f
commit 3ccfd0417b
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605

View File

@ -345,6 +345,9 @@ export const NoteRepository = db.getRepository(Note).extend({
.select('note.renoteId')
.where('note.userId = :meId', { meId })
.andWhere('note.renoteId IN (:...targets)', { targets })
.andWhere('note.text IS NULL')
.andWhere('note.hasPoll = FALSE')
.andWhere(`note.fileIds = '{}'`)
.getMany();
for (const target of targets) {