Can search for Comunic users

This commit is contained in:
2021-07-12 17:18:39 +02:00
parent 8ed706272f
commit 93122d54b9
2 changed files with 93 additions and 40 deletions

View 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,
});
}
}