Chore: Migrate REST API - getAvatarSuggestion to Typescript (#3869)

This commit is contained in:
Reinaldo Neto 2022-03-10 09:25:25 -03:00 committed by GitHub
parent 4ea8d613a9
commit 5d28453201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -57,6 +57,14 @@ export interface IAvatar {
service?: any; service?: any;
} }
export interface IAvatarSuggestion {
[service: string]: {
url: string;
blob: string;
contentType: string;
};
}
export interface IProfileViewState { export interface IProfileViewState {
saving: boolean; saving: boolean;
name: string; name: string;
@ -66,13 +74,7 @@ export interface IProfileViewState {
currentPassword: string | null; currentPassword: string | null;
avatarUrl: string | null; avatarUrl: string | null;
avatar: IAvatar; avatar: IAvatar;
avatarSuggestions: { avatarSuggestions: IAvatarSuggestion;
[service: string]: {
url: string;
blob: string;
contentType: string;
};
};
customFields: { customFields: {
[key: string | number]: string; [key: string | number]: string;
}; };

View File

@ -3,7 +3,7 @@ import { TEAM_TYPE } from '../../../definitions/ITeam';
import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType'; import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType';
import { SubscriptionType, INotificationPreferences, IRoomNotifications } from '../../../definitions'; import { SubscriptionType, INotificationPreferences, IRoomNotifications } from '../../../definitions';
import { ISpotlight } from '../../../definitions/ISpotlight'; import { ISpotlight } from '../../../definitions/ISpotlight';
import { IParams } from '../../../definitions/IProfileViewInterfaces'; import { IAvatarSuggestion, IParams } from '../../../definitions/IProfileViewInterfaces';
export const createChannel = ({ export const createChannel = ({
name, name,
@ -566,7 +566,7 @@ export const getRoomRoles = (roomId: string, type: SubscriptionType): any =>
// @ts-ignore // @ts-ignore
sdk.get(`${roomTypeToApiType(type)}.roles`, { roomId }); sdk.get(`${roomTypeToApiType(type)}.roles`, { roomId });
export const getAvatarSuggestion = () => export const getAvatarSuggestion = (): Promise<IAvatarSuggestion> =>
// RC 0.51.0 // RC 0.51.0
sdk.methodCallWrapper('getAvatarSuggestion'); sdk.methodCallWrapper('getAvatarSuggestion');