overleaf/services/web/app/coffee/Features/Referal/ReferalHandler.coffee

9 lines
305 B
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
User = require('../../models/User').User
module.exports =
getReferedUsers: (user_id, callback)->
2014-02-12 05:23:40 -05:00
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