I doubt itll work, but...

This commit is contained in:
ThatOneCalculator 2022-08-09 00:53:57 -07:00
parent 7fd1f05bb3
commit b475ea415d

View file

@ -1,6 +1,6 @@
import { Brackets } from 'typeorm';
import { fetchMeta } from '@/misc/fetch-meta.js';
import { Notes, Users } from '@/models/index.js';
import { Notes } from '@/models/index.js';
import { activeUsersChart } from '@/services/chart/index.js';
import define from '../../define.js';
import { ApiError } from '../../error.js';
@ -64,12 +64,11 @@ export default define(meta, paramDef, async (ps, user) => {
throw new ApiError(meta.errors.rtlDisabled);
}
}
console.log(`\n\n${m.recommendedInstances}\n\n`)
//#region Construct query
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
.andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances })
.andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') })
// .andWhere(new Brackets(qb => {
// qb.where('note.userHost IN :instances', { instances: m.recommendedInstances })
// .orWhere('note.userHost IS NULL');