Remove 'this' usage from UserUpdater

GitOrigin-RevId: f49126b69b22f8f6860d77ba07d9ae8fd68b5aaf
This commit is contained in:
Simon Detheridge 2019-08-09 12:35:53 +01:00 committed by sharelatex
parent c0cc8fdd3f
commit 7d253651ca

View file

@ -113,7 +113,7 @@ module.exports = UserUpdater = {
emails: { email: newEmail, createdAt: new Date(), reversedHostname }
}
}
return this.updateUser(userId, update, function(error) {
return UserUpdater.updateUser(userId, update, function(error) {
if (error != null) {
logger.warn({ error }, 'problem updating users emails')
return callback(error)
@ -139,7 +139,7 @@ module.exports = UserUpdater = {
const query = { _id: userId, email: { $ne: email } }
const update = { $pull: { emails: { email } } }
return this.updateUser(query, update, function(error, res) {
return UserUpdater.updateUser(query, update, function(error, res) {
if (error != null) {
logger.warn({ error }, 'problem removing users email')
return callback(error)
@ -223,7 +223,7 @@ module.exports = UserUpdater = {
'emails.$.confirmedAt': confirmedAt
}
}
return this.updateUser(query, update, function(error, res) {
return UserUpdater.updateUser(query, update, function(error, res) {
if (error != null) {
return callback(error)
}