chore: add rest api return (#3864)

This commit is contained in:
Alex Junior 2022-03-09 13:49:52 -03:00 committed by GitHub
parent 7a9cdde474
commit abd9722133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -111,6 +111,7 @@ export interface INotificationPreferences {
desktopNotifications: TNotifications;
pushNotifications: TNotifications;
emailNotificationMode?: 'mentions' | 'nothing';
language?: string;
}
export interface IUserPreferences {

View File

@ -26,7 +26,7 @@ export type UsersEndpoints = {
};
};
'users.setPreferences': {
POST: (params: { userId: IUser['_id']; data: Partial<INotificationPreferences> }) => {
POST: (params: { userId?: IUser['_id']; data: Partial<INotificationPreferences> }) => {
user: IUserPreferences;
success: boolean;
};

View File

@ -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<INotificationPreferences>) =>
// RC 0.62.0
// TODO: missing definitions from server
// @ts-ignore
sdk.post('users.setPreferences', { data });
export const saveNotificationSettings = (roomId: string, notifications: any): any =>