|
@@ -51,7 +51,7 @@ document.getElementById('registerForm').addEventListener('submit', function (e)
|
|
|
body: JSON.stringify(data)
|
|
body: JSON.stringify(data)
|
|
|
})
|
|
})
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
- if (response.status === 400) {
|
|
|
|
|
|
|
+ if (response.status !== 200 && response.status !== 201) {
|
|
|
return response.json().then(errorData => {
|
|
return response.json().then(errorData => {
|
|
|
showErrorMessage(errorData.message || 'Error al registrar el usuario.');
|
|
showErrorMessage(errorData.message || 'Error al registrar el usuario.');
|
|
|
});
|
|
});
|