baucis-decorator-instance
Version:
Forces `of` and `descendants` population.
20 lines (18 loc) • 373 B
JavaScript
/**
* Forces `of` and `descendants` population.
*
* @api public
*/
exports = module.exports = instance;
function instance () {
this.request('get', function (req, res, next) {
if (req.query.populate) {
req.query.populate += ' ';
} else {
req.query.populate = '';
}
req.query.populate += 'of descendants';
next();
});
}
;