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.
@@ -13859,7 +13859,21 @@ var RegisterFormEcComponent = /** @class */ (function (_super) {
13859
13859
  }, function (error) {
13860
13860
  _this.register_loading = false;
13861
13861
  if (error.status == 400) {
13862
- _this.toastr.showPersistent('El email ingresado ya se encuentra registrado.');
13862
+ var backendError = error.error;
13863
+ if (backendError &&
13864
+ backendError.errors &&
13865
+ backendError.errors.email &&
13866
+ backendError.errors.email.length > 0) {
13867
+ // Mostrar el primer mensaje de error de email
13868
+ _this.toastr.showPersistent(backendError.errors.email[0]);
13869
+ }
13870
+ else if (backendError && backendError.message) {
13871
+ // Si no hay mensaje específico, pero hay mensaje general del backend
13872
+ _this.toastr.showPersistent(backendError.message);
13873
+ }
13874
+ else {
13875
+ _this.toastr.showPersistent('El email ingresado ya se encuentra registrado.');
13876
+ }
13863
13877
  }
13864
13878
  else {
13865
13879
  _this.toastr.show('Error en el registro. Vuelva a intentarlo más tarde.');