try this instead
This commit is contained in:
parent
209cd8a7c8
commit
7ea17df2ba
|
@ -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`
|
||||
|
|
Loading…
Reference in New Issue