mirror of
https://github.com/FAUSheppy/jeffrey_miller_flask_ftp
synced 2025-12-10 08:38:34 +01:00
add js del user
This commit is contained in:
@@ -38,6 +38,15 @@ function submitForm(){
|
|||||||
xhr.send(formData);
|
xhr.send(formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deleteUser(username){
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("POST", "/delete-user");
|
||||||
|
xhr.onload = formSubmitFinished
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append("username", username)
|
||||||
|
xhr.send(formData);
|
||||||
|
}
|
||||||
|
|
||||||
function formSubmitFinished(event){
|
function formSubmitFinished(event){
|
||||||
if(event.target.status < 200 || event.target.status >= 300){
|
if(event.target.status < 200 || event.target.status >= 300){
|
||||||
showErrorMessage(event.target); // blocking
|
showErrorMessage(event.target); // blocking
|
||||||
|
|||||||
Reference in New Issue
Block a user