diff --git a/app/definitions/IUser.ts b/app/definitions/IUser.ts index aaf49bd28..6dfbdf5e7 100644 --- a/app/definitions/IUser.ts +++ b/app/definitions/IUser.ts @@ -111,6 +111,7 @@ export interface INotificationPreferences { desktopNotifications: TNotifications; pushNotifications: TNotifications; emailNotificationMode?: 'mentions' | 'nothing'; + language?: string; } export interface IUserPreferences { diff --git a/app/definitions/rest/v1/users.ts b/app/definitions/rest/v1/users.ts index e8e27c9d4..b72f4821a 100644 --- a/app/definitions/rest/v1/users.ts +++ b/app/definitions/rest/v1/users.ts @@ -26,7 +26,7 @@ export type UsersEndpoints = { }; }; 'users.setPreferences': { - POST: (params: { userId: IUser['_id']; data: Partial }) => { + POST: (params: { userId?: IUser['_id']; data: Partial }) => { user: IUserPreferences; success: boolean; }; diff --git a/app/lib/rocketchat/services/restApi.ts b/app/lib/rocketchat/services/restApi.ts index aa3e40142..6bb6e6c1c 100644 --- a/app/lib/rocketchat/services/restApi.ts +++ b/app/lib/rocketchat/services/restApi.ts @@ -551,10 +551,8 @@ export const saveUserProfile = (data: any, customFields?: any): any => // @ts-ignore sdk.post('users.updateOwnBasicInfo', { data, customFields }); -export const saveUserPreferences = (data: any): any => +export const saveUserPreferences = (data: Partial) => // RC 0.62.0 - // TODO: missing definitions from server - // @ts-ignore sdk.post('users.setPreferences', { data }); export const saveNotificationSettings = (roomId: string, notifications: any): any =>