Ghost/core/frontend/services/rendering/render-entries.js
Hannah Wolfe 08479f3816
Moved routing helpers to rendering service
- The helpers folder was full of things used for rendering pages
- It belongs as its own service so that we can see what it really does
2022-04-05 20:12:20 +01:00

20 lines
580 B
JavaScript

const debug = require('@tryghost/debug')('services:routing:renderer: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));
};
};