mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
838fe00058
Notify users when affiliations are upgraded GitOrigin-RevId: 0f9e92b6a49f2ddef559e9e23fc73436910fb9f6
12 lines
463 B
CoffeeScript
12 lines
463 B
CoffeeScript
logger = require("logger-sharelatex")
|
|
User = require('../../models/User').User
|
|
|
|
module.exports =
|
|
updateFeatures: (user_id, features, callback = (err, features, featuresChanged)->)->
|
|
conditions = _id:user_id
|
|
update = {}
|
|
logger.log user_id:user_id, features:features, "updating users features"
|
|
update["features.#{key}"] = value for key, value of features
|
|
User.update conditions, update, (err, result)->
|
|
callback err, features, result?.nModified == 1
|
|
|