implement deletion of admin user, frontend and backend
This commit is contained in:
@@ -65,8 +65,21 @@
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
async function deleteUser() {
|
||||
async function deleteUser(userId: number) {
|
||||
const URL = `/api/users/${userId}`;
|
||||
|
||||
const response = await fetch(URL, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
|
||||
if (response.status == 204) {
|
||||
userList = await getUsers();
|
||||
} else {
|
||||
alert("Nutzer konnte nicht gelöscht werden")
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user