From e2ebe83238e02fe9a48e9590b6aa765185495115 Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 1 Mar 2023 23:45:34 -0500 Subject: [PATCH] Convert limit parameter to int for certain Mastodon account endpoints --- .../backend/src/server/api/mastodon/endpoints/account.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 312e381359..3e9da57501 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -42,6 +42,7 @@ export function apiAccountMastodon(router: Router): void { sensitive: false, language: "", }; + console.log(acct); ctx.body = acct; } catch (e: any) { console.error(e); @@ -126,7 +127,7 @@ export function apiAccountMastodon(router: Router): void { try { const data = await client.getAccountFollowers( ctx.params.id, - ctx.query as any, + limitToInt(ctx.query as any), ); ctx.body = data.data; } catch (e: any) { @@ -146,7 +147,7 @@ export function apiAccountMastodon(router: Router): void { try { const data = await client.getAccountFollowing( ctx.params.id, - ctx.query as any, + limitToInt(ctx.query as any), ); ctx.body = data.data; } catch (e: any) {