mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 20:23:49 +01:00
idk
This commit is contained in:
parent
675c93cc5c
commit
8f00c7067f
@ -1,6 +1,6 @@
|
||||
import { Brackets } from 'typeorm';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Notes, Metas } from '@/models/index.js';
|
||||
import { Notes, Users } from '@/models/index.js';
|
||||
import { activeUsersChart } from '@/services/chart/index.js';
|
||||
import define from '../../define.js';
|
||||
import { ApiError } from '../../error.js';
|
||||
@ -67,14 +67,10 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||
|
||||
// .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances })
|
||||
//#region Construct query
|
||||
const recommendedQuery = Metas.createQueryBuilder('meta')
|
||||
.select('meta.recommendedInstances')
|
||||
.where('meta.recommendedInstances = ANY');
|
||||
|
||||
const query = makePaginationQuery(Notes.createQueryBuilder('note'),
|
||||
ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate)
|
||||
.andWhere(new Brackets(qb => {
|
||||
qb.where(`note.userHost IN (${recommendedQuery.getQuery()})`)
|
||||
qb.where('note.userHost IN :instances', { instances: m.recommendedInstances })
|
||||
.orWhere('note.userHost IS NULL');
|
||||
}))
|
||||
.andWhere('(note.visibility = \'public\')')
|
||||
|
Loading…
Reference in New Issue
Block a user