ng-easycommerce 0.0.644 → 0.0.645

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ # version 0.0.645
2
+ - mejorar manejo de errores al registrar email no valido. En `register-form-ec`.
1
3
  # version 0.0.644
2
4
  - se corrigio para considerar `allowAnyPaymentMethod` y `allowExceedBalance` antes de redirigir al checkout
3
5
  # version 0.0.643
@@ -13845,7 +13845,21 @@
13845
13845
  }, function (error) {
13846
13846
  _this.register_loading = false;
13847
13847
  if (error.status == 400) {
13848
- _this.toastr.showPersistent('El email ingresado ya se encuentra registrado.');
13848
+ var backendError = error.error;
13849
+ if (backendError &&
13850
+ backendError.errors &&
13851
+ backendError.errors.email &&
13852
+ backendError.errors.email.length > 0) {
13853
+ // Mostrar el primer mensaje de error de email
13854
+ _this.toastr.showPersistent(backendError.errors.email[0]);
13855
+ }
13856
+ else if (backendError && backendError.message) {
13857
+ // Si no hay mensaje específico, pero hay mensaje general del backend
13858
+ _this.toastr.showPersistent(backendError.message);
13859
+ }
13860
+ else {
13861
+ _this.toastr.showPersistent('El email ingresado ya se encuentra registrado.');
13862
+ }
13849
13863
  }
13850
13864
  else {
13851
13865
  _this.toastr.show('Error en el registro. Vuelva a intentarlo más tarde.');