Refactor antibot ui function and update template.html

This commit is contained in:
Théophile Diot 2024-01-31 15:35:28 +01:00
parent db084c6f11
commit 7377909976
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
2 changed files with 2 additions and 5 deletions

View file

@ -1,5 +1,2 @@
import json
def antibot():
return json.dumps({"message": "ok", "data": {"info": "test", "count": 24}})
return {"message": "ok", "data": {"info": "test", "count": 24}}

View file

@ -126,13 +126,13 @@
fetch(location.href, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-CSRFToken": "{{ csrf_token() }}",
},
})
.then((res) => res.json())
.then((res) => {
console.log(res);
console.log(JSON.stringify(res));
console.log(res.data);
console.log(res.data.data);
// Update data and DOM