Page MenuHomePhabricator

D11961.diff
No OneTemporary

D11961.diff

diff --git a/lib/types/entry-types.js b/lib/types/entry-types.js
--- a/lib/types/entry-types.js
+++ b/lib/types/entry-types.js
@@ -19,7 +19,7 @@
fifteenDaysLater,
thisMonthDates,
} from '../utils/date-utils.js';
-import { tID, tShape } from '../utils/validation-utils.js';
+import { tUserID, tID, tShape } from '../utils/validation-utils.js';
export type RawEntryInfo = {
id?: string, // null if local copy without ID yet
@@ -46,7 +46,7 @@
month: t.Number,
day: t.Number,
creationTime: t.Number,
- creatorID: t.String,
+ creatorID: tUserID,
deleted: t.Boolean,
});
diff --git a/lib/types/history-types.js b/lib/types/history-types.js
--- a/lib/types/history-types.js
+++ b/lib/types/history-types.js
@@ -2,7 +2,7 @@
import t, { type TInterface } from 'tcomb';
-import { tID, tShape } from '../utils/validation-utils.js';
+import { tID, tShape, tUserID } from '../utils/validation-utils.js';
export type HistoryMode = 'day' | 'entry';
@@ -19,7 +19,7 @@
tShape<HistoryRevisionInfo>({
id: tID,
entryID: tID,
- authorID: t.String,
+ authorID: tUserID,
text: t.String,
lastUpdate: t.Number,
deleted: 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
@@ -11,7 +11,7 @@
type UserRelationshipStatus,
userRelationshipStatusValidator,
} from './relationship-types.js';
-import { tBool, tShape } from '../utils/validation-utils.js';
+import { tBool, tShape, tUserID } from '../utils/validation-utils.js';
export type GlobalUserInfo = {
+id: string,
@@ -57,7 +57,7 @@
};
export const accountUserInfoValidator: TInterface<AccountUserInfo> =
tShape<AccountUserInfo>({
- id: t.String,
+ id: tUserID,
username: t.String,
relationshipStatus: t.maybe(userRelationshipStatusValidator),
avatar: t.maybe(clientAvatarValidator),
diff --git a/lib/types/validators/entry-validators.js b/lib/types/validators/entry-validators.js
--- a/lib/types/validators/entry-validators.js
+++ b/lib/types/validators/entry-validators.js
@@ -3,7 +3,7 @@
import t from 'tcomb';
import type { TInterface } from 'tcomb';
-import { tShape, tID } from '../../utils/validation-utils.js';
+import { tShape, tID, tUserID } from '../../utils/validation-utils.js';
import {
type DeleteEntryResponse,
type RestoreEntryResponse,
@@ -23,7 +23,7 @@
export const fetchEntryInfosResponseValidator: TInterface<FetchEntryInfosResponse> =
tShape<FetchEntryInfosResponse>({
rawEntryInfos: t.list(rawEntryInfoValidator),
- userInfos: t.dict(t.String, accountUserInfoValidator),
+ userInfos: t.dict(tUserID, accountUserInfoValidator),
});
export const fetchEntryRevisionInfosResultValidator: TInterface<FetchEntryRevisionInfosResult> =

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 5:02 PM (11 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2707639
Default Alt Text
D11961.diff (2 KB)

Event Timeline