Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3298867
D11963.id40055.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
D11963.id40055.diff
View Options
diff --git a/lib/shared/updates/delete-account-spec.js b/lib/shared/updates/delete-account-spec.js
--- a/lib/shared/updates/delete-account-spec.js
+++ b/lib/shared/updates/delete-account-spec.js
@@ -11,7 +11,7 @@
AccountDeletionUpdateInfo,
} from '../../types/update-types.js';
import type { UserInfos } from '../../types/user-types.js';
-import { tNumber, tShape } from '../../utils/validation-utils.js';
+import { tNumber, tShape, tUserID } from '../../utils/validation-utils.js';
export const deleteAccountSpec: UpdateSpec<
AccountDeletionUpdateInfo,
@@ -98,6 +98,6 @@
type: tNumber(updateTypes.DELETE_ACCOUNT),
id: t.String,
time: t.Number,
- deletedUserID: t.String,
+ deletedUserID: tUserID,
}),
});
diff --git a/lib/shared/updates/update-user-spec.js b/lib/shared/updates/update-user-spec.js
--- a/lib/shared/updates/update-user-spec.js
+++ b/lib/shared/updates/update-user-spec.js
@@ -9,7 +9,7 @@
UserRawUpdateInfo,
UserUpdateData,
} from '../../types/update-types.js';
-import { tNumber, tShape } from '../../utils/validation-utils.js';
+import { tNumber, tShape, tUserID } from '../../utils/validation-utils.js';
export const updateUserSpec: UpdateSpec<
UserUpdateInfo,
@@ -62,6 +62,6 @@
type: tNumber(updateTypes.UPDATE_USER),
id: t.String,
time: t.Number,
- updatedUserID: t.String,
+ updatedUserID: tUserID,
}),
});
diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js
--- a/lib/types/thread-types.js
+++ b/lib/types/thread-types.js
@@ -35,7 +35,7 @@
import type { UserInfo, UserInfos } from './user-types.js';
import type { SpecialRole } from '../permissions/special-roles.js';
import { type ThreadEntity } from '../utils/entity-text.js';
-import { tID, tShape } from '../utils/validation-utils.js';
+import { tID, tShape, tUserID } from '../utils/validation-utils.js';
export type LegacyMemberInfo = {
+id: string,
@@ -45,7 +45,7 @@
};
export const legacyMemberInfoValidator: TInterface<LegacyMemberInfo> =
tShape<LegacyMemberInfo>({
- id: t.String,
+ id: tUserID,
role: t.maybe(tID),
permissions: threadPermissionsInfoValidator,
isSender: t.Boolean,
diff --git a/lib/types/user-types.js b/lib/types/user-types.js
--- a/lib/types/user-types.js
+++ b/lib/types/user-types.js
@@ -38,7 +38,7 @@
+avatar?: ?ClientAvatar,
};
export const userInfoValidator: TInterface<UserInfo> = tShape<UserInfo>({
- id: t.String,
+ id: tUserID,
username: t.maybe(t.String),
relationshipStatus: t.maybe(userRelationshipStatusValidator),
avatar: t.maybe(clientAvatarValidator),
@@ -82,7 +82,7 @@
};
export const loggedInUserInfoValidator: TInterface<LoggedInUserInfo> =
tShape<LoggedInUserInfo>({
- id: t.String,
+ id: tUserID,
username: t.String,
settings: t.maybe(defaultNotificationPayloadValidator),
avatar: t.maybe(clientAvatarValidator),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 9:34 AM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2534452
Default Alt Text
D11963.id40055.diff (2 KB)
Attached To
Mode
D11963: [lib] Use tUserID in entry-validators.js pt.3 - serverCreateUpdatesResponseValidator
Attached
Detach File
Event Timeline
Log In to Comment