This commit is contained in:
ThatOneCalculator 2022-07-29 00:33:51 -07:00
parent 7852e3ae4a
commit e2db8dd230

View File

@ -66,11 +66,15 @@ export default define(meta, paramDef, async (ps, user) => {
}
}
// .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances })
//#region Construct query
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere(new Brackets(qb => {
qb.where('((note.userHost IN (:instances))', { instances: instances })
.orWhere('(note.userHost IS NULL)');
}))
.andWhere('(note.visibility = \'public\')')
.andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances })
.innerJoinAndSelect('note.user', 'user')
.leftJoinAndSelect('user.avatar', 'avatar')
.leftJoinAndSelect('user.banner', 'banner')