angular-fullstack/generator-angular-fullstack

Backend Validation for Unique Email for Sql Buggy

Open

#2,159 创建于 2016年8月18日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (6,134 star) (1,268 fork)batch import
Help Wanted

描述

  • 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.

贡献者指南