From 7ea17df2ba04e5da9b876f0638d67af5f6a2b532 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Sun, 12 Feb 2023 00:19:35 +0100 Subject: [PATCH] try this instead --- .../backend/src/server/api/mastodon/endpoints/account.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index cb9f6c4efe..fe48e4a116 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -70,11 +70,11 @@ export function apiAccountMastodon(router: Router): void { const accessTokens = ctx.headers.authorization; const client = getClient(BASE_URL, accessTokens); try { - const data = await client.searchAccount((ctx.query.acct || '').toString(), { + const data = await client.search((ctx.query.acct || '').toString(), "accounts", { resolve: true }); - ctx.body = data.data[0]; - if (data.data.length === 0) { + ctx.body = data.data.accounts[0]; + if (data.data.accounts.length === 0) { ctx.status = 404; ctx.body = { error: `Record (${ctx.query.acct}) not found`