mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 01:13:48 +01:00
🙏
This commit is contained in:
parent
8dc7c748f8
commit
eaefe05982
@ -59,6 +59,7 @@ export const paramDef = {
|
|||||||
// eslint-disable-next-line import/no-default-export
|
// eslint-disable-next-line import/no-default-export
|
||||||
export default define(meta, paramDef, async (ps, user) => {
|
export default define(meta, paramDef, async (ps, user) => {
|
||||||
const m = await fetchMeta();
|
const m = await fetchMeta();
|
||||||
|
const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`;
|
||||||
if (m.disableRecommendedTimeline) {
|
if (m.disableRecommendedTimeline) {
|
||||||
if (user == null || (!user.isAdmin && !user.isModerator)) {
|
if (user == null || (!user.isAdmin && !user.isModerator)) {
|
||||||
throw new ApiError(meta.errors.rtlDisabled);
|
throw new ApiError(meta.errors.rtlDisabled);
|
||||||
@ -68,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||||||
//#region Construct query
|
//#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('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') })
|
.andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: formatted })
|
||||||
// .andWhere(new Brackets(qb => {
|
// .andWhere(new Brackets(qb => {
|
||||||
// qb.where('note.userHost IN :instances', { instances: m.recommendedInstances })
|
// qb.where('note.userHost IN :instances', { instances: m.recommendedInstances })
|
||||||
// .orWhere('note.userHost IS NULL');
|
// .orWhere('note.userHost IS NULL');
|
||||||
|
Loading…
Reference in New Issue
Block a user