From 1b1796c2aa24ac18dba31fa0faec481b847060f4 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:13:08 -0700 Subject: [PATCH] not a fan of js/ts --- .../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 20a73798d..c95159ef4 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,14 +59,14 @@ 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(', ')})`; + 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 (ARRAY[${m.recommendedInstances}])`; + const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'),