Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
deleteuser admin
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 27, 2024
1 parent 69db609 commit 09f436e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,25 @@ <h1 class="text-left">Templates de VMs</h1>
}
});
}

function deleteUser(userId) {
$.ajax({
type: 'DELETE',
url: 'https://api.insa-cvl.com/deleteuser',
contentType: 'application/json;charset=UTF-8',
data: JSON.stringify({ user_id: userId }),
xhrFields: {
withCredentials: true
},
success: function (response) {
alert('Utilisateur supprimé avec succès!');
location.reload();
},
error: function (error) {
alert('Erreur lors de la suppression de l\'utilisateur.');
}
});
}

function addTemplateToDOM(template) {
var templateCard = createTemplateCard(template);
Expand Down
2 changes: 1 addition & 1 deletion templates/professor.html
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
$('#addVMOutCard').on('click', function () {
$("#createVmModal").modal("show");
});
$('#addUserCard').on('click', function () {
$('#addUserButton').on('click', function () {
$("#createUserModal").modal("show");
});
});
Expand Down

0 comments on commit 09f436e

Please sign in to comment.