Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3380068
D11605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D11605.diff
View Options
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<RelationshipErrors>) =>
+ ): ((request: RelationshipRequest) => Promise<RelationshipErrors>) =>
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,
+ type 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<RelationshipErrors>,
// withOverlayContext
+overlayContext: ?OverlayContextType,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 8:50 PM (22 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2594885
Default Alt Text
D11605.diff (2 KB)
Attached To
Mode
D11605: [lib] Re-introduce `RelationshipRequest` and replace `TraditionalRelationshipRequest` where simple
Attached
Detach File
Event Timeline
Log In to Comment