30 lines
717 B
TypeScript
30 lines
717 B
TypeScript
import { useKeycloak } from "@react-keycloak/web"
|
|
import { getAllCoach, getUsersAPI, postAdmin } from "../requetes"
|
|
import { Admin } from "../classes";
|
|
|
|
|
|
function TestAPI(){
|
|
const { keycloak } = useKeycloak()
|
|
|
|
function handleGetUsers(): void {
|
|
getAllCoach();
|
|
}
|
|
|
|
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
|