Convert limit parameter to int for certain Mastodon account endpoints

This commit is contained in:
Luna 2023-03-01 23:45:34 -05:00
parent b7ffa05848
commit e2ebe83238
No known key found for this signature in database
GPG Key ID: 1899404574D6EEFC
1 changed files with 3 additions and 2 deletions

View File

@ -42,6 +42,7 @@ export function apiAccountMastodon(router: Router): void {
sensitive: false, sensitive: false,
language: "", language: "",
}; };
console.log(acct);
ctx.body = acct; ctx.body = acct;
} catch (e: any) { } catch (e: any) {
console.error(e); console.error(e);
@ -126,7 +127,7 @@ export function apiAccountMastodon(router: Router): void {
try { try {
const data = await client.getAccountFollowers( const data = await client.getAccountFollowers(
ctx.params.id, ctx.params.id,
ctx.query as any, limitToInt(ctx.query as any),
); );
ctx.body = data.data; ctx.body = data.data;
} catch (e: any) { } catch (e: any) {
@ -146,7 +147,7 @@ export function apiAccountMastodon(router: Router): void {
try { try {
const data = await client.getAccountFollowing( const data = await client.getAccountFollowing(
ctx.params.id, ctx.params.id,
ctx.query as any, limitToInt(ctx.query as any),
); );
ctx.body = data.data; ctx.body = data.data;
} catch (e: any) { } catch (e: any) {