mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
search: fix lookupPubkey for account search endpoint
This commit is contained in:
parent
8f5ec50a25
commit
fd90c199f5
1 changed files with 2 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ import { Storages } from '@/storages.ts';
|
||||||
import { uploadFile } from '@/utils/upload.ts';
|
import { uploadFile } from '@/utils/upload.ts';
|
||||||
import { nostrNow } from '@/utils.ts';
|
import { nostrNow } from '@/utils.ts';
|
||||||
import { createEvent, paginated, parseBody, updateListEvent } from '@/utils/api.ts';
|
import { createEvent, paginated, parseBody, updateListEvent } from '@/utils/api.ts';
|
||||||
import { extractIdentifier, lookupAccount } from '@/utils/lookup.ts';
|
import { extractIdentifier, lookupAccount, lookupPubkey } from '@/utils/lookup.ts';
|
||||||
import { renderAccounts, renderEventAccounts, renderStatuses } from '@/views.ts';
|
import { renderAccounts, renderEventAccounts, renderStatuses } from '@/views.ts';
|
||||||
import { accountFromPubkey, renderAccount } from '@/views/mastodon/accounts.ts';
|
import { accountFromPubkey, renderAccount } from '@/views/mastodon/accounts.ts';
|
||||||
import { renderRelationship } from '@/views/mastodon/relationships.ts';
|
import { renderRelationship } from '@/views/mastodon/relationships.ts';
|
||||||
|
|
@ -129,7 +129,7 @@ const accountSearchController: AppController = async (c) => {
|
||||||
const event = await lookupAccount(lookup ?? query);
|
const event = await lookupAccount(lookup ?? query);
|
||||||
|
|
||||||
if (!event && lookup) {
|
if (!event && lookup) {
|
||||||
const pubkey = bech32ToPubkey(lookup);
|
const pubkey = await lookupPubkey(lookup);
|
||||||
return c.json(pubkey ? [await accountFromPubkey(pubkey)] : []);
|
return c.json(pubkey ? [await accountFromPubkey(pubkey)] : []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue