import { useKeycloak } from "@react-keycloak/web"
import { getCoachsAPI, getUsersAPI, postAdmin } from "../requetes"
import { Admin } from "../classes";


function TestAPI(){
    const { keycloak } = useKeycloak()

    function handleGetUsers(): void {
        getCoachsAPI();
    }

    function handleSendAdmin(): void {
        const admin = new Admin;
        admin.nom = "admin";
        admin.email = "admin@gmail.com";

        postAdmin(admin);
    }

    return(
        <div style={{padding:30, backgroundColor:"#000000"}}>
           <button onClick={()=>handleGetUsers()}>getUsers</button>
           <button onClick={()=>handleSendAdmin()}>sendAdmin</button>
        </div>
    )
}

export default TestAPI
