From fcbee6d3f5ac0a2e25e0b62eaa3ab6176d2ea8a0 Mon Sep 17 00:00:00 2001 From: fruye Date: Wed, 15 Mar 2023 21:38:12 +0100 Subject: [PATCH] fix: Run to boolean conversion in mastoAPI public and hashtag timelines The `only_media` query parameter in `/api/v1/timelines/public` and `/api/v1/timelines/tag/:hashtag` was previously passed directly as-is to the Misskey API, which made it pretty upset because it was receiving a string named 'true' instead of the value 'true'. Needed for pleromaFE to display a timeline. --- .../backend/src/server/api/mastodon/endpoints/timeline.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index 1b5afd6d06..58ca8d6771 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -92,8 +92,8 @@ export function apiTimelineMastodon(router: Router): void { try { const query: any = ctx.query; const data = query.local - ? await client.getLocalTimeline(limitToInt(query)) - : await client.getPublicTimeline(limitToInt(query)); + ? await client.getLocalTimeline(argsToBools(limitToInt(query))) + : await client.getPublicTimeline(argsToBools(limitToInt(query))); ctx.body = toTextWithReaction(data.data, ctx.hostname); } catch (e: any) { console.error(e); @@ -111,7 +111,7 @@ export function apiTimelineMastodon(router: Router): void { try { const data = await client.getTagTimeline( ctx.params.hashtag, - limitToInt(ctx.query), + argsToBools(limitToInt(ctx.query)), ); ctx.body = toTextWithReaction(data.data, ctx.hostname); } catch (e: any) {