mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
UX Fix: clear all existing messages and errors
This commit is contained in:
parent
33b15acbe9
commit
2fef6d7d45
8 changed files with 94 additions and 0 deletions
|
|
@ -71,6 +71,8 @@ function SignUpClient(props: SignUpClientProps) {
|
|||
},
|
||||
validate,
|
||||
onSubmit: async values => {
|
||||
setError('')
|
||||
setMessage('')
|
||||
setIsSubmitting(true);
|
||||
let res = await signup(values);
|
||||
let message = await res.json();
|
||||
|
|
@ -82,6 +84,7 @@ function SignUpClient(props: SignUpClientProps) {
|
|||
else if (res.status == 401 || res.status == 400 || res.status == 404 || res.status == 409) {
|
||||
setError(message.detail);
|
||||
setIsSubmitting(false);
|
||||
|
||||
}
|
||||
else {
|
||||
setError("Something went wrong");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue