From 1b52864f3eb9a4ac36a51e0f9e6f3791f7da8084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Mon, 8 Jun 2015 13:55:55 +0200 Subject: [PATCH] remove testing from watch process --- gulpfile.js | 2 +- js/mixins/form_mixin.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 0bd15054..bf9dd46d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -45,7 +45,7 @@ gulp.task('build', function() { bundle(false); }); -gulp.task('serve', ['browser-sync', 'jest:watch', 'lint:watch', 'sass', 'sass:watch', 'copy'], function() { +gulp.task('serve', ['browser-sync', 'lint:watch', 'sass', 'sass:watch', 'copy'], function() { bundle(true); }); diff --git a/js/mixins/form_mixin.js b/js/mixins/form_mixin.js index 98876ddb..aab55124 100644 --- a/js/mixins/form_mixin.js +++ b/js/mixins/form_mixin.js @@ -9,7 +9,6 @@ export const FormMixin = { getInitialState() { return { submitted: false, - status: null, errors: [] }; }, @@ -23,12 +22,14 @@ export const FormMixin = { .then(() => { this.props.handleSuccess(); }) .catch(this.handleError); }, + clearErrors(){ for (var ref in this.refs){ this.refs[ref].clearAlerts(); } - this.setState({errors:[]}); + this.setState({errors: []}); }, + handleError(err){ if (err.json) { for (var input in err.json.errors){ @@ -39,8 +40,8 @@ export const FormMixin = { } } } - else{ - this.setState({errors: ['Something went wrong, please try again later"']}); + else { + this.setState({errors: ['Something went wrong, please try again later']}); } this.setState({submitted: false}); },