Can now delete user, and also asks user to confirm action

This commit is contained in:
Peter KW 2024-03-28 12:39:23 +01:00
parent 48e53b8768
commit a96f0fb488

View file

@ -49,7 +49,13 @@ function UserInfoModal(props: {
<Button <Button
text={"Delete"} text={"Delete"}
onClick={function (): void { onClick={function (): void {
DeleteUser({ usernameToDelete: props.username }); if (
window.confirm("Are you sure you want to delete this user?")
) {
DeleteUser({
usernameToDelete: props.username,
});
}
}} }}
type="button" type="button"
/> />