Blame view

apps/home/controllers/general-tabs.js 511 Bytes
htoooth authored
1 2 3
'use strict';

const _ = require('lodash');
htoooth authored
4
const headerService = require('../models/general-tabs-service');
htoooth authored
5 6

const getCommonHeader = (req, res, next) => {
htoooth authored
7 8 9
    let channel = req.query.channel;
    let uid = req.user.uid;
    let clientService = _.get(req.app.locals.pc, 'clientService.new', false);
htoooth authored
10
htoooth authored
11
    headerService.getHomeNav(uid, channel, req.originalUrl, clientService).then((result)=>{
htoooth authored
12 13
        _.merge(res.locals, result);
        next();
htoooth authored
14
    }).catch(next);
htoooth authored
15 16 17 18 19
};

module.exports = {
    getCommonHeader
};