mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
5b40eca697
Added projection to User.find() queries in Referal feature GitOrigin-RevId: 4929bcd9c1b242b7e35cc2632bbd8da3f378cd1d
23 lines
627 B
JavaScript
23 lines
627 B
JavaScript
const ReferalHandler = require('./ReferalHandler')
|
|
const AuthenticationController = require('../Authentication/AuthenticationController')
|
|
|
|
module.exports = {
|
|
bonus(req, res, next) {
|
|
const userId = AuthenticationController.getLoggedInUserId(req)
|
|
ReferalHandler.getReferedUsers(
|
|
userId,
|
|
(err, referedUsers, referedUserCount) => {
|
|
if (err) {
|
|
next(err)
|
|
} else {
|
|
res.render('referal/bonus', {
|
|
title: 'bonus_please_recommend_us',
|
|
refered_users: referedUsers,
|
|
refered_user_count: referedUserCount
|
|
})
|
|
}
|
|
}
|
|
)
|
|
}
|
|
}
|