diff --git a/lib/actions/community-actions.js b/lib/actions/community-actions.js --- a/lib/actions/community-actions.js +++ b/lib/actions/community-actions.js @@ -1,11 +1,13 @@ // @flow +import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import { useKeyserverCall } from '../keyserver-conn/keyserver-call.js'; import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js'; import type { ServerCommunityInfo, FetchCommunityInfosResponse, + FetchAllCommunityInfosWithNamesResponse, CreateOrUpdateFarcasterChannelTagRequest, CreateOrUpdateFarcasterChannelTagResponse, DeleteFarcasterChannelTagRequest, @@ -59,6 +61,21 @@ return useKeyserverCall(fetchCommunityInfos); } +const fetchAllCommunityInfosWithNamesActionTypes = Object.freeze({ + started: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_STARTED', + success: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_SUCCESS', + failed: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_FAILED', +}); +const fetchAllCommunityInfosWithNames = + ( + callSingleKeyserverEndpoint: CallSingleKeyserverEndpoint, + ): (() => Promise) => + async () => { + return await callSingleKeyserverEndpoint( + 'fetch_all_community_infos_with_names', + ); + }; + const createOrUpdateFarcasterChannelTagActionTypes = Object.freeze({ started: 'CREATE_OR_UPDATE_FARCASTER_CHANNEL_TAG_STARTED', success: 'CREATE_OR_UPDATE_FARCASTER_CHANNEL_TAG_SUCCESS', @@ -143,6 +160,8 @@ addCommunityActionType, fetchCommunityInfosActionTypes, useFetchCommunityInfos, + fetchAllCommunityInfosWithNamesActionTypes, + fetchAllCommunityInfosWithNames, createOrUpdateFarcasterChannelTagActionTypes, useCreateOrUpdateFarcasterChannelTag, deleteFarcasterChannelTagActionTypes, diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -33,6 +33,7 @@ CommunityStore, AddCommunityPayload, FetchCommunityInfosResponse, + FetchAllCommunityInfosWithNamesResponse, CreateOrUpdateFarcasterChannelTagResponse, DeleteFarcasterChannelTagPayload, } from './community-types.js'; @@ -1470,6 +1471,22 @@ +payload: Error, +loadingInfo: LoadingInfo, } + | { + +type: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_STARTED', + +loadingInfo?: LoadingInfo, + +payload?: void, + } + | { + +type: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_SUCCESS', + +payload: FetchAllCommunityInfosWithNamesResponse, + +loadingInfo: LoadingInfo, + } + | { + +type: 'FETCH_ALL_COMMUNITY_INFOS_WITH_NAMES_FAILED', + +error: true, + +payload: Error, + +loadingInfo: LoadingInfo, + } | { +type: 'CREATE_OR_UPDATE_FARCASTER_CHANNEL_TAG_STARTED', +loadingInfo?: LoadingInfo,