angular-fullstack/generator-angular-fullstack

Backend Validation for Unique Email for Sql Buggy

Open

#2159 aperta il 18 ago 2016

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (1268 fork)batch import
Help Wanted

Metriche repository

Star
 (6134 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 3.7.5
Node 4.4.5
npm 3.9.6
Operating System Windows7
yo 1.8.4
Item Answer
Transpiler Babel
Markup HTML
CSS SCSS
Router ui-router
Build Tool Gulp
Client Tests Mocha
DB MsSQL
Auth Y
etc etc

Hey, I have Installed this Generator anew using: yo angular-fullstack For the Validation with MsSql for unique Email there is a Bug?

 // Update validity of form fields that match the sequelize errors
          if (err.name) {
            angular.forEach(err.fields, field => {
              form[field].$setValidity('mongoose', false);
              this.errors[field] = err.message;
            });
          }
        });

This is the Generated code for SQL user. It throws normally a 422 Error but as well TypeError: Cannot read property '$setValidity' of undefined So as well there is no "This Email is alrleady used..." Error Message output. Changing the code to the same as for MongoDb

 // Update validity of form fields that match the sequelize errors
          if (err.name) {
            angular.forEach(err.fields, (error,field) => {
              form[field].$setValidity('mongoose', false);
              this.errors[field] = err.message;
            });
          }
        });

Solves the Problem. Tried it with the Generated Admin and TestUser after a Clean Install.

Guida contributor