In my module.exports:
module.exports.getselectedtimeperiod = function getselectedtimeperiod (request, reply) {
var from = request.query.from || Moment().subtract(5, 'day')
var to = request.query.to || Moment.now()
var fromDate = Moment(from).unix()
var toDate = Moment(to).unix()
var url = config.LOG_SKOLESKYSS_GET_APPLICATIONS + fromDate + '/' + toDate
Wreck.get(url, wreckOptions, function (err, data, payload) {
if (err) {
reply(err)
}
request.yar.set({'sokerdata': payload})
reply.view('show-applicants', payload)
})
}
I would like to send a “payload” and “viewOptions” to my views, which contains (the title for the tab) and other specific variables in the package.json file. is there any way to overcome this problem? Of course, getting errors when trying to do it like this:
reply.view('show-applicants', payload, viewOptions)
source
share