Merge branch 'refactor-remove-await' into 'main'

refactor: remove await

See merge request soapbox-pub/ditto!688
This commit is contained in:
P. Reis 2025-02-26 14:20:16 +00:00
commit 937a9a58ee

View file

@ -100,11 +100,11 @@ const accountLookupController: AppController = async (c) => {
const event = await lookupAccount(decodeURIComponent(acct), c.var); const event = await lookupAccount(decodeURIComponent(acct), c.var);
if (event) { if (event) {
assertAuthenticated(c, event); assertAuthenticated(c, event);
return c.json(await renderAccount(event)); return c.json(renderAccount(event));
} }
try { try {
const pubkey = bech32ToPubkey(decodeURIComponent(acct)); const pubkey = bech32ToPubkey(decodeURIComponent(acct));
return c.json(await accountFromPubkey(pubkey!)); return c.json(accountFromPubkey(pubkey!));
} catch { } catch {
return c.json({ error: 'Could not find user.' }, 404); return c.json({ error: 'Could not find user.' }, 404);
} }