Clears username+password fields on successful register
This commit is contained in:
parent
58deef400a
commit
dc98fb510e
1 changed files with 2 additions and 0 deletions
|
@ -22,6 +22,8 @@ export default function Register(): JSX.Element {
|
||||||
const response = await api.registerUser(newUser);
|
const response = await api.registerUser(newUser);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
alert("User added!");
|
alert("User added!");
|
||||||
|
setPassword("");
|
||||||
|
setUsername("");
|
||||||
} else {
|
} else {
|
||||||
alert("User not added");
|
alert("User not added");
|
||||||
setErrMessage(response.message ?? "Unknown error");
|
setErrMessage(response.message ?? "Unknown error");
|
||||||
|
|
Loading…
Reference in a new issue