Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2931962
D13638.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13638.diff
View Options
diff --git a/keyserver/src/scripts/delete-all-fc-channel-tags.js b/keyserver/src/scripts/delete-all-fc-channel-tags.js
new file mode 100644
--- /dev/null
+++ b/keyserver/src/scripts/delete-all-fc-channel-tags.js
@@ -0,0 +1,29 @@
+// @flow
+
+import { main } from './utils.js';
+import { deleteFarcasterChannelTag } from '../deleters/farcaster-channel-tag-deleters.js';
+import { fetchAllCommunityInfosWithNames } from '../fetchers/community-fetchers.js';
+import { createScriptViewer } from '../session/scripts.js';
+import { thisKeyserverAdmin } from '../user/identity.js';
+
+async function deleteAllFCChannelTags() {
+ const admin = await thisKeyserverAdmin();
+ const adminViewer = createScriptViewer(admin.id);
+
+ const allCommunityInfosWithNames = await fetchAllCommunityInfosWithNames();
+
+ const deleteFarcasterChannelTagPromises = allCommunityInfosWithNames
+ .map(communityInfoWithName => {
+ if (!communityInfoWithName.farcasterChannelID) {
+ return null;
+ }
+ return deleteFarcasterChannelTag(adminViewer, {
+ commCommunityID: communityInfoWithName.id,
+ farcasterChannelID: communityInfoWithName.farcasterChannelID,
+ });
+ })
+ .filter(Boolean);
+ await Promise.all(deleteFarcasterChannelTagPromises);
+}
+
+main([deleteAllFCChannelTags]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 10, 10:24 PM (19 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2269045
Default Alt Text
D13638.diff (1 KB)
Attached To
Mode
D13638: [keyserver] delete all fc channel tags
Attached
Detach File
Event Timeline
Log In to Comment