This commit is contained in:
thaaoblues 2024-01-16 17:22:00 +01:00
parent 26731533b6
commit 0a1e215a8f

View file

@ -34,14 +34,14 @@
</body> </body>
<script> <script>
async function test_auth(){ async function test_auth(){
resp = await fetch("/annales/api.php/test_auth"); resp = await fetch("api.php/test_auth");
data = await resp.json(); data = await resp.json();
document.getElementById("user_status").innerText = data["msg"]; document.getElementById("user_status").innerText = data["msg"];
} }
// fonction de test, innutile en prod // fonction de test, innutile en prod
async function authenticate_user(){ async function authenticate_user(){
resp = await fetch("/annales/api.php/auth"); resp = await fetch("api.php/auth");
data = await resp.json(); data = await resp.json();
console.log("test"); console.log("test");
if(data.status == 1){ if(data.status == 1){
@ -51,7 +51,7 @@
async function unauthenticate_user(){ async function unauthenticate_user(){
resp = await fetch("/annales/api.php/unauth"); resp = await fetch("api.php/unauth");
data = await resp.json(); data = await resp.json();
if(data.status == 1){ if(data.status == 1){
document.getElementById("user_status").innerText = data["msg"]; document.getElementById("user_status").innerText = data["msg"];
@ -70,7 +70,7 @@
var duree =document.getElementById("duree_input").value var duree =document.getElementById("duree_input").value
var url = "/annales/api.php/rechercher?req="+req; var url = "api.php/rechercher?req="+req;
if(themes.toString() != ""){ if(themes.toString() != ""){
url = url +"&themes="+themes.toString(); url = url +"&themes="+themes.toString();
} }
@ -122,7 +122,7 @@
async function gen_chronologie(){ async function gen_chronologie(){
var url = "/annales/api.php/generer_chronologie"; var url = "api.php/generer_chronologie";
console.log(url); console.log(url);