Ghost/core/frontend/services/routing/helpers/render-entries.js
naz 8ddf83f3c5
Fixed "no-shadow" linting error in server modules (#12287)
refs 143921948d

- Continuation of changes started in referenced commit
2020-10-20 12:02:56 +13:00

20 lines
584 B
JavaScript

const debug = require('ghost-ignition').debug('services:routing:helpers:render-entries');
const formatResponse = require('./format-response');
const renderer = require('./renderer');
/**
* @description Helper to handle rendering multiple resources.
*
* @param {Object} req
* @param {Object} res
* @returns {Closure)
*/
module.exports = function renderEntries(req, res) {
debug('renderEntries called');
return function renderEntriesClosure(result) {
// Format data 2
// Render
return renderer(req, res, formatResponse.entries(result));
};
};