This commit is contained in:
ThatOneCalculator 2022-08-04 14:25:54 -07:00
parent b376d3e98e
commit 26e82b73dc

View file

@ -65,6 +65,7 @@ export default define(meta, paramDef, async (ps, user) => {
} }
} }
// .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances })
//#region Construct query //#region Construct query
const recommendedQuery = Metas.createQueryBuilder('meta') const recommendedQuery = Metas.createQueryBuilder('meta')
.select('meta.recommendedInstances') .select('meta.recommendedInstances')
@ -73,8 +74,8 @@ export default define(meta, paramDef, async (ps, user) => {
const query = makePaginationQuery(Notes.createQueryBuilder('note'), const query = makePaginationQuery(Notes.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere(new Brackets(qb => { .andWhere(new Brackets(qb => {
qb.where(`((note.userHost IN (${ recommendedQuery.getQuery() }))`); qb.where(`note.userHost IN (${recommendedQuery.getQuery()})`)
// .orWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)'); .orWhere('note.userHost IS NULL');
})) }))
.andWhere('(note.visibility = \'public\')') .andWhere('(note.visibility = \'public\')')
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')