mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
accountSearchController: actually use the looked up event, whoops
This commit is contained in:
parent
fd90c199f5
commit
a24c119c7b
1 changed files with 6 additions and 4 deletions
|
|
@ -133,11 +133,13 @@ const accountSearchController: AppController = async (c) => {
|
|||
return c.json(pubkey ? [await accountFromPubkey(pubkey)] : []);
|
||||
}
|
||||
|
||||
const events = await store.query([{ kinds: [0], search: query, limit }], { signal })
|
||||
.then((events) => hydrateEvents({ events, store, signal }));
|
||||
const events = event ? [event] : await store.query([{ kinds: [0], search: query, limit }], { signal });
|
||||
|
||||
const accounts = await Promise.all(
|
||||
const accounts = await hydrateEvents({ events, store, signal }).then(
|
||||
(events) =>
|
||||
Promise.all(
|
||||
events.map((event) => renderAccount(event)),
|
||||
),
|
||||
);
|
||||
|
||||
return c.json(accounts);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue