brackets
This commit is contained in:
parent
b51a8750a3
commit
1372a246b5
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue