From 8d9596d209f2065789a02ab895f234feea92db02 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:32:50 -0700 Subject: [PATCH] Clean up --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 +--- 1 file changed, 1 insertion(+), 3 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 b86f644477..ae2d582745 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,18 +59,16 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - // 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); } } - const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(cursed) + .andWhere(`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`) .andWhere('(note.visibility = \'public\')') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar')