diff --git a/lib/actions/relationship-actions.js b/lib/actions/relationship-actions.js --- a/lib/actions/relationship-actions.js +++ b/lib/actions/relationship-actions.js @@ -1,8 +1,8 @@ // @flow import type { - TraditionalRelationshipRequest, RelationshipErrors, + RelationshipRequest, } from '../types/relationship-types.js'; import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js'; import { ServerError } from '../utils/errors.js'; @@ -15,9 +15,7 @@ const updateRelationships = ( callSingleKeyserverEndpoint: CallSingleKeyserverEndpoint, - ): (( - request: TraditionalRelationshipRequest, - ) => Promise) => + ): ((request: RelationshipRequest) => Promise) => async request => { const errors = await callSingleKeyserverEndpoint( 'update_relationships', diff --git a/lib/types/relationship-types.js b/lib/types/relationship-types.js --- a/lib/types/relationship-types.js +++ b/lib/types/relationship-types.js @@ -77,6 +77,10 @@ +userIDsToFID: { +[userID: string]: string }, }; +export type RelationshipRequest = + | TraditionalRelationshipRequest + | FarcasterRelationshipRequest; + const exactlyTwoDictEntriesValidator = t.refinement( t.dict(t.String, t.String), dict => Object.keys(dict).length === 2, diff --git a/native/profile/relationship-list-item.react.js b/native/profile/relationship-list-item.react.js --- a/native/profile/relationship-list-item.react.js +++ b/native/profile/relationship-list-item.react.js @@ -12,11 +12,11 @@ import type { LoadingStatus } from 'lib/types/loading-types.js'; import type { ReactRef } from 'lib/types/react-types.js'; import { - type TraditionalRelationshipRequest, type RelationshipAction, type RelationshipErrors, userRelationshipStatus, relationshipActions, + RelationshipRequest, } from 'lib/types/relationship-types.js'; import type { AccountUserInfo, @@ -111,7 +111,7 @@ +dispatchActionPromise: DispatchActionPromise, // async functions that hit server APIs +updateRelationships: ( - request: TraditionalRelationshipRequest, + request: RelationshipRequest, ) => Promise, // withOverlayContext +overlayContext: ?OverlayContextType,