Merge pull request #1814 from overleaf/spd-missing-callback-returns

Add missing return statements to callbacks in SubscriptionGroupHandler

GitOrigin-RevId: 05ff67bd8e4997fde01c6cf9f4558d3caa261590
This commit is contained in:
Simon Detheridge 2019-05-28 10:15:55 +01:00 committed by sharelatex
parent 561f54c1a3
commit 6488fd1284

View file

@ -18,11 +18,12 @@ module.exports = SubscriptionGroupHandler =
SubscriptionUpdater.removeUserFromGroup subscriptionId, userToRemove_id, callback
replaceUserReferencesInGroups: (oldId, newId, callback) ->
logger.log old_id: oldId, new_id: newId, "replacing user reference in groups"
Subscription.update {admin_id: oldId}, {admin_id: newId}, (error) ->
callback(error) if error?
return callback(error) if error?
replaceInArray Subscription, "manager_ids", oldId, newId, (error) ->
callback(error) if error?
return callback(error) if error?
replaceInArray Subscription, "member_ids", oldId, newId, callback