send invalid_email error type down when sharing project

This commit is contained in:
Henry Oswald 2018-02-07 14:28:49 +00:00
parent df9b866bee
commit 696e9d27d6
2 changed files with 1 additions and 3 deletions

View file

@ -65,7 +65,7 @@ module.exports = CollaboratorsInviteController =
email = EmailHelper.parseEmail(email)
if !email? or email == ""
logger.log {projectId, email, sendingUserId}, "invalid email address"
return res.sendStatus(400)
return res.status(400).send({errorReason:"invalid_email"})
CollaboratorsInviteController._checkRateLimit sendingUserId, (error, underRateLimit) ->
return next(error) if error?
if !underRateLimit

View file

@ -134,8 +134,6 @@ define [
if data?.errorReason?
$scope.state.errorReason = data?.errorReason
else if status? and status == 400
$scope.state.errorReason = 'invalid_email'
else
$scope.state.errorReason = null