Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3518295
D13718.id45214.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D13718.id45214.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 7:31 PM (18 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696062
Default Alt Text
D13718.id45214.diff (3 KB)
Attached To
Mode
D13718: [lib] change fetchFarcasterChannelByName -> fetchFarcasterChannelByID and refactor
Attached
Detach File
Event Timeline
Log In to Comment