Display the list of spaces
This commit is contained in:
26
matrixgw_frontend/src/api/matrix/MatrixApiProfile.ts
Normal file
26
matrixgw_frontend/src/api/matrix/MatrixApiProfile.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { APIClient } from "../ApiClient";
|
||||
|
||||
export interface UserProfile {
|
||||
user_id: string;
|
||||
display_name?: string;
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
export type UsersMap = Map<string, UserProfile>;
|
||||
|
||||
export class MatrixApiProfile {
|
||||
/**
|
||||
* Get multiple profiles information
|
||||
*/
|
||||
static async GetMultiple(ids: string[]): Promise<UsersMap> {
|
||||
const list: UserProfile[] = (
|
||||
await APIClient.exec({
|
||||
method: "POST",
|
||||
uri: "/matrix/profile/get_multiple",
|
||||
jsonData: ids,
|
||||
})
|
||||
).data;
|
||||
|
||||
return new Map(list.map((e) => [e.user_id, e]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user