Can now delete user, and also asks user to confirm action
This commit is contained in:
parent
48e53b8768
commit
a96f0fb488
1 changed files with 7 additions and 1 deletions
|
@ -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"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue