Index.js 545 Bytes
'use strict';

const indexService = require('../models/index-service');

const index = (req, res, next)=>{
    let uid = req.user.uid;
    let udid = req.user.uid + req.yoho.udid;
    let channel = req.yoho.channel;
    let isStudent = req.user.isStudent;

    indexService.index(uid, udid, channel, isStudent).then((result) => {
        return res.render('index', {
            module: 'home',
            page: 'index',
            meIndexPage: true,
            me: result
        });
    }).catch(next);
};

module.exports = {
    index
};