redenvelopes.js 444 Bytes
'use strict';
const Promise = require('bluebird');
const co = Promise.coroutine;
const redenvelopesModel = require('../models/redenvelopes-model');

const index = (req, res, next)=>{
    let uid = req.user.uid;

    co(function*() {
        let result = yield redenvelopesModel.redenvelopesList(uid);

        res.render('redenvelopes', {
            meRedEnvelopes: result
        });
    })().catch(next);
};

module.exports = {
    index
};