Skip to content

Commit

Permalink
Unify user data API between server and frontend (#3432)
Browse files Browse the repository at this point in the history
* Unify position of the "email" key/property between backend and various frontend definitions
* Add missing "theme" key to the ApiUserData type
  • Loading branch information
mathjazz authored Nov 6, 2024
1 parent 4b23a5d commit da516ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion translate/src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export type ApiUserData = {
is_admin?: boolean;
is_pm?: boolean;
id?: string;
email?: string;
display_name?: string;
name_or_email?: string;
email?: string;
username?: string;
date_joined?: string;
can_manage_locales?: string[];
Expand All @@ -51,6 +51,7 @@ export type ApiUserData = {
notifications: Notification[];
unread_count: string;
};
theme?: string;
};

/** All users for use in mentions suggestions within comments */
Expand Down
4 changes: 2 additions & 2 deletions translate/src/modules/user/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export type UserState = {
readonly isAdmin: boolean;
readonly isPM: boolean;
readonly id: string;
readonly email: string;
readonly displayName: string;
readonly nameOrEmail: string;
readonly email: string;
readonly username: string;
readonly dateJoined: string;
readonly canManageLocales: Array<string>;
Expand All @@ -97,9 +97,9 @@ const initial: UserState = {
isAdmin: false,
isPM: false,
id: '',
email: '',
displayName: '',
nameOrEmail: '',
email: '',
username: '',
dateJoined: '',
canManageLocales: [],
Expand Down

0 comments on commit da516ae

Please sign in to comment.