Chore: Migrate REST API - setUserStatus to Typescript (#3828)
* chore: add rest api return * chore: add rest api return
This commit is contained in:
parent
c72b524ac0
commit
d43da089bf
|
@ -132,7 +132,7 @@ export interface IUser extends IRocketChatRecord, Omit<ILoggedUser, 'username' |
|
|||
name?: string;
|
||||
services?: IUserServices;
|
||||
emails?: IUserEmail[];
|
||||
status?: UserStatus;
|
||||
status: UserStatus;
|
||||
statusConnection?: string;
|
||||
lastLogin?: Date;
|
||||
avatarOrigin?: string;
|
||||
|
|
|
@ -34,4 +34,7 @@ export type UsersEndpoints = {
|
|||
'users.register': {
|
||||
POST: (params: { name: string; email: string; username: string; pass: string }) => { user: IUserRegistered };
|
||||
};
|
||||
'users.setStatus': {
|
||||
POST: (params: { status: string; message: string }) => {};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -265,10 +265,8 @@ export const setUserPreferences = (userId: string, data: Partial<INotificationPr
|
|||
// RC 0.62.0
|
||||
sdk.post('users.setPreferences', { userId, data });
|
||||
|
||||
export const setUserStatus = (status?: string, message?: string): any =>
|
||||
export const setUserStatus = (status: string, message: string) =>
|
||||
// RC 1.2.0
|
||||
// TODO: missing definitions from server
|
||||
// @ts-ignore
|
||||
sdk.post('users.setStatus', { status, message });
|
||||
|
||||
export const setReaction = (emoji: string, messageId: string) =>
|
||||
|
|
|
@ -11,7 +11,7 @@ import SafeAreaView from '../containers/SafeAreaView';
|
|||
import Status from '../containers/Status/Status';
|
||||
import TextInput from '../containers/TextInput';
|
||||
import { LISTENER } from '../containers/Toast';
|
||||
import { IApplicationState, IBaseScreen } from '../definitions';
|
||||
import { IApplicationState, IBaseScreen, IUser } from '../definitions';
|
||||
import I18n from '../i18n';
|
||||
import RocketChat from '../lib/rocketchat';
|
||||
import { getUserSelector } from '../selectors/login';
|
||||
|
@ -54,19 +54,13 @@ const styles = StyleSheet.create({
|
|||
}
|
||||
});
|
||||
|
||||
interface IUser {
|
||||
id?: string;
|
||||
status?: string;
|
||||
statusText?: string;
|
||||
}
|
||||
|
||||
interface IStatusViewState {
|
||||
statusText: string;
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
interface IStatusViewProps extends IBaseScreen<any, 'StatusView'> {
|
||||
user: IUser;
|
||||
user: Pick<IUser, 'id' | 'status' | 'statusText'>;
|
||||
isMasterDetail: boolean;
|
||||
Accounts_AllowInvisibleStatusOption: boolean;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue