From 48e53b876896d15370b2a31b5872831d2730820f Mon Sep 17 00:00:00 2001 From: Peter KW Date: Thu, 28 Mar 2024 12:38:40 +0100 Subject: [PATCH] Added some alerts --- frontend/src/Components/DeleteUser.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/DeleteUser.tsx b/frontend/src/Components/DeleteUser.tsx index db49724..d1dbc7f 100644 --- a/frontend/src/Components/DeleteUser.tsx +++ b/frontend/src/Components/DeleteUser.tsx @@ -11,7 +11,6 @@ import { api, APIResponse } from "../API/API"; */ function DeleteUser(props: { usernameToDelete: string }): boolean { - //console.log(props.usernameToDelete); FOR DEBUG let removed = false; api .removeUser( @@ -20,12 +19,16 @@ function DeleteUser(props: { usernameToDelete: string }): boolean { ) .then((response: APIResponse) => { if (response.success) { + alert("User has been deleted!"); + location.reload(); removed = true; } else { + alert("User has not been deleted"); console.error(response.message); } }) .catch((error) => { + alert("User has not been deleted"); console.error("An error occurred during creation:", error); }); return removed;