diff --git a/keyserver/src/updaters/thread-updaters.js b/keyserver/src/updaters/thread-updaters.js --- a/keyserver/src/updaters/thread-updaters.js +++ b/keyserver/src/updaters/thread-updaters.js @@ -1001,7 +1001,7 @@ })(), ); - const channelInfo = await neynarClient?.fetchFarcasterChannelByName( + const channelInfo = await neynarClient?.fetchFarcasterChannelByID( communityFarcasterChannelTag, ); if (channelInfo) { diff --git a/lib/utils/neynar-client.js b/lib/utils/neynar-client.js --- a/lib/utils/neynar-client.js +++ b/lib/utils/neynar-client.js @@ -23,10 +23,6 @@ }, }; -type FetchFarcasterChannelByNameResponse = { - +channels: $ReadOnlyArray, -}; - type FetchUsersResponse = { +users: $ReadOnlyArray, }; @@ -153,11 +149,9 @@ return this.fetchFollowedFarcasterChannelsWithFilter(fid, () => true); } - async fetchFarcasterChannelByName( - channelName: string, - ): Promise { + async fetchFarcasterChannelByID(channelID: string): Promise { const params: { [string]: string } = { - q: channelName, + q: channelID, }; const url = getNeynarURL('2', 'channel/search', params); @@ -171,12 +165,11 @@ }, }); - const json: FetchFarcasterChannelByNameResponse = await response.json(); - + const json: FetchFarcasterChannelsResponse = await response.json(); const { channels } = json; for (const channel of channels) { - if (channel.id.toLowerCase() === channelName.toLowerCase()) { + if (channel.id.toLowerCase() === channelID.toLowerCase()) { return channel; } } @@ -184,7 +177,7 @@ return null; } catch (error) { console.log( - 'Failed to search Farcaster channel by name:', + `Failed to search Farcaster channel by ID:`, getMessageForException(error) ?? 'unknown', ); throw error; diff --git a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel-by-name.react.js b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel-by-name.react.js --- a/native/community-settings/tag-farcaster-channel/tag-farcaster-channel-by-name.react.js +++ b/native/community-settings/tag-farcaster-channel/tag-farcaster-channel-by-name.react.js @@ -49,7 +49,7 @@ const onPressTagChannel = React.useCallback(async () => { const channelInfo = - await neynarClientContext.client.fetchFarcasterChannelByName( + await neynarClientContext.client.fetchFarcasterChannelByID( channelSelectionText, ); diff --git a/web/tag-farcaster-channel/create-farcaster-channel-tag-modal.react.js b/web/tag-farcaster-channel/create-farcaster-channel-tag-modal.react.js --- a/web/tag-farcaster-channel/create-farcaster-channel-tag-modal.react.js +++ b/web/tag-farcaster-channel/create-farcaster-channel-tag-modal.react.js @@ -89,7 +89,7 @@ } const channelInfo = - await neynarClientContext.client.fetchFarcasterChannelByName( + await neynarClientContext.client.fetchFarcasterChannelByID( channelNameText, ); if (!channelInfo) {