Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-14 14:17:21 +01:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
@@ -67,28 +67,30 @@ function resendConfirmation(req, res, next) {
if (!email) {
return res.sendStatus(422)
}
UserGetter.getUserByAnyEmail(email, { _id: 1 }, function(error, user) {
UserGetter.getUserByAnyEmail(email, { _id: 1 }, function (error, user) {
if (error) {
return next(error)
}
if (!user || user._id.toString() !== userId) {
return res.sendStatus(422)
}
UserEmailsConfirmationHandler.sendConfirmationEmail(userId, email, function(
error
) {
if (error) {
return next(error)
UserEmailsConfirmationHandler.sendConfirmationEmail(
userId,
email,
function (error) {
if (error) {
return next(error)
}
res.sendStatus(200)
}
res.sendStatus(200)
})
)
})
}
const UserEmailsController = {
list(req, res, next) {
const userId = AuthenticationController.getLoggedInUserId(req)
UserGetter.getUserFullEmails(userId, function(error, fullEmails) {
UserGetter.getUserFullEmails(userId, function (error, fullEmails) {
if (error) {
return next(error)
}
@@ -105,7 +107,7 @@ const UserEmailsController = {
return res.sendStatus(422)
}
UserUpdater.removeEmailAddress(userId, email, function(error) {
UserUpdater.removeEmailAddress(userId, email, function (error) {
if (error) {
return next(error)
}
@@ -163,7 +165,7 @@ const UserEmailsController = {
email,
req.body.role,
req.body.department,
function(error) {
function (error) {
if (error) {
return next(error)
}
@@ -188,19 +190,22 @@ const UserEmailsController = {
message: req.i18n.translate('confirmation_link_broken')
})
}
UserEmailsConfirmationHandler.confirmEmailFromToken(token, function(error) {
if (error) {
if (error instanceof Errors.NotFoundError) {
res.status(404).json({
message: req.i18n.translate('confirmation_token_invalid')
})
UserEmailsConfirmationHandler.confirmEmailFromToken(
token,
function (error) {
if (error) {
if (error instanceof Errors.NotFoundError) {
res.status(404).json({
message: req.i18n.translate('confirmation_token_invalid')
})
} else {
next(error)
}
} else {
next(error)
res.sendStatus(200)
}
} else {
res.sendStatus(200)
}
})
)
},
_handleEmailError(error, req, res, next) {