This commit is contained in:
ThatOneCalculator 2022-08-04 14:16:22 -07:00
parent de7db2cc3e
commit a8b3bdaebd

View File

@ -70,12 +70,11 @@ export default define(meta, paramDef, async (ps, user) => {
.select('meta.recommendedInstances') .select('meta.recommendedInstances')
.where('meta.recommendedInstances = ANY'); .where('meta.recommendedInstances = ANY');
//#region Construct query
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.visibility = \'public\') AND (note.userHost IS NULL)');
})) }))
.andWhere('(note.visibility = \'public\')') .andWhere('(note.visibility = \'public\')')
.innerJoinAndSelect('note.user', 'user') .innerJoinAndSelect('note.user', 'user')