overleaf/services/web/app/coffee/Features/Referal/ReferalHandler.coffee
Simon Detheridge 8b55643f7e Merge pull request #1030 from sharelatex/spd-bonus-program
Implement bonus program

GitOrigin-RevId: a18dd8a916c6f317a11661f106cdb4a2983c4ad8
2018-10-23 11:36:17 +00:00

8 lines
305 B
CoffeeScript

User = require('../../models/User').User
module.exports =
getReferedUsers: (user_id, callback)->
User.findById user_id, (err, user)->
refered_users = user.refered_users || []
refered_user_count= user.refered_user_count || refered_users.length
callback null, refered_users, refered_user_count