From 7a4ddeba16e7b92aedcb4de737a04cc66165192b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:02:11 -0700 Subject: [PATCH] hail mairy --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index ec7f225b3..b4b4ba674 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,7 +59,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`; + const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(v.toString())).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#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: formatted }) + .andWhere('(note.userHost IN :instances)', { instances: formattedInstances }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL');