mirror of
https://gitlab.com/comunic/comunicconsole
synced 2025-12-07 20:05:16 +00:00
Can search for Comunic users
This commit is contained in:
33
src/helpers/ComunicUsersHelper.ts
Normal file
33
src/helpers/ComunicUsersHelper.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Comunic users management
|
||||
*
|
||||
* @author Pierre Hubert
|
||||
*/
|
||||
|
||||
import { serverRequest } from "./APIHelper";
|
||||
|
||||
export interface SearchResult {
|
||||
id: number;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
email: string;
|
||||
account_image: string;
|
||||
}
|
||||
|
||||
export class ComunicUsersHelper {
|
||||
/**
|
||||
* Search for Comunic users
|
||||
*
|
||||
* @param name The name of the user to search
|
||||
* @param email The email address of the user to search
|
||||
*/
|
||||
static async SearchUser(
|
||||
name: string,
|
||||
email: string
|
||||
): Promise<SearchResult[]> {
|
||||
return await serverRequest("users/search", {
|
||||
name: name,
|
||||
email: email,
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user