0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/services/routing/helpers/render-entry.js
kirrg001 ab49d1eed6 Added comments for routing service
no issue

- jsdoc
- inline comments
2019-04-21 23:55:22 +02:00

18 lines
583 B
JavaScript

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