github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/server/frontend/bv/src/pages/accueil/controller.ts (about) 1 import { 2 BaseController, 3 adjustUrlOrigin, 4 UrlServerBase 5 } from "@/shared/logic/controller"; 6 import { SearchMailOut, SearchMailIn } from "@/shared/logic/types"; 7 import Axios, { AxiosResponse } from "axios"; 8 import { Misc } from "@/shared/logic/api"; 9 10 export class Controller extends BaseController { 11 async searchMail(mail: string) { 12 const params: SearchMailIn = { Mail: mail }; 13 try { 14 let resp: AxiosResponse<SearchMailOut> = await Axios.post( 15 UrlServerBase + Misc.SearchMail, 16 params 17 ); 18 return resp.data; 19 } catch (error) { 20 this.notifications.onAxiosError(error); 21 } 22 } 23 } 24 25 export const C = new Controller();