Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
itaisteinherz committed Feb 7, 2019
1 parent 096c406 commit 8967c94
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 16 additions & 15 deletions client/components/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ class RegisterForm extends React.Component {

handleSubmit = e => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
this.props.form.validateFields(async (err, values) => {
if (!err) { // The given inputs are valid.
this.props.signup(values)
.then(error => {
this.setState({error});
})
.catch(error => {
this.setState({error});
});
let validationError;
try {
validationError = await this.props.signup(values);
} catch (error) {
validationError = error;
}

this.setState({error: validationError});
}
});
};

validateEmail = (rule, value, callback) => {
const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (value && !emailRegex.test(value.toLowerCase())) {
callback("Badly formatted email");
}
Expand Down Expand Up @@ -126,12 +127,12 @@ class RegisterForm extends React.Component {
</Link>
</Form>
{error &&
<Alert
description={error.message}
type="error"
showIcon
/>
}
<Alert
showIcon
description={error.message}
type="error"
/>
}
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion server/components/tags/tag-controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.getTagQuestions = async (req, res) => {
$options: "i"
}}).select("_id");

console.log('tagId', tagId)
console.log("tagId", tagId);
try {
const questions = await Question
.find({tags: tagId._id})
Expand Down

0 comments on commit 8967c94

Please sign in to comment.