-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Get authenticated user
Edit authenticated user
The User interface does not match the structure in the documentation.
For now the User interface is:
crowdin-api-client-js/src/users/index.ts
Lines 344 to 359 in a58c89e
| export interface User { | |
| id: number; | |
| username: string; | |
| email: string; | |
| firstName: string; | |
| lastName: string; | |
| status: Status; | |
| avatarUrl: string; | |
| fields: Record<string, any>; | |
| createdAt: string; | |
| lastSeen: string; | |
| twoFactor: TwoFactor; | |
| isAdmin: boolean; | |
| timezone: string; | |
| emailVerified: string; | |
| } |
But in doc it is:
{
"data": {
"id": 12,
"username": "john_smith",
"email": "[email protected]",
"emailVerified": "false",
"fullName": "John Smith",
"avatarUrl": "",
"createdAt": "2019-07-11T07:40:22+00:00",
"lastSeen": "2019-10-23T11:44:02+00:00",
"twoFactor": "enabled",
"timezone": "Europe/Kyiv"
}
}Also the project has duplicated User interfaces with shorter data
crowdin-api-client-js/src/issues/index.ts
Lines 89 to 94 in a58c89e
| export interface User { | |
| id: number; | |
| username: string; | |
| fullName: string; | |
| avatarUrl: string; | |
| } |
| export interface User { |
| export interface User { |
crowdin-api-client-js/src/sourceFiles/index.ts
Line 1016 in 4313341
| export interface User { |
I suggest to create a ShortUser interface in UsersModel and using it instead of the duplicate interfaces mentioned above. I also suggest to extend the main UsersModel.User interface with UsersModel.ShortUser to avoid duplicating parameters.
export interface ShortUser {
id: number;
username: string;
fullName: string;
avatarUrl: string;
}This is the issue described in #585 (comment)