frontend: Hotfix loading

This commit is contained in:
Divlo
2020-03-25 18:46:23 +01:00
parent 7d49422108
commit 96af78f967
2 changed files with 6 additions and 6 deletions

View File

@ -18,13 +18,16 @@ const Register = () => {
}
const handleSubmit = (event) => {
setIsLoading(true);
event.preventDefault();
api.post('/users/register', inputState)
.then(({ data }) => {
setMessage(`<p class="form-success"><b>Succès:</b> ${data.result}</p>`);
setIsLoading(false);
})
.catch((error) => {
setMessage(`<p class="form-error"><b>Erreur:</b> ${error.response.data.message}</p>`);
setIsLoading(false);
});
}