Page MenuHomePhabricator

D13718.id45247.diff
No OneTemporary

D13718.id45247.diff

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<NeynarChannel>,
-};
-
type FetchUsersResponse = {
+users: $ReadOnlyArray<NeynarUser>,
};
@@ -153,11 +149,9 @@
return this.fetchFollowedFarcasterChannelsWithFilter(fid, () => true);
}
- async fetchFarcasterChannelByName(
- channelName: string,
- ): Promise<?NeynarChannel> {
+ async fetchFarcasterChannelByID(channelID: string): Promise<?NeynarChannel> {
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) {

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 9:23 AM (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2543893
Default Alt Text
D13718.id45247.diff (3 KB)

Event Timeline