0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added TODO's for entry and preview controller

refs #9866
This commit is contained in:
kirrg001 2018-10-17 13:24:12 +02:00 committed by Katharina Irrgang
parent cbf2817e39
commit d8a7edd9aa
2 changed files with 19 additions and 0 deletions

View file

@ -14,6 +14,17 @@ module.exports = function previewController(req, res, next) {
include: 'author,authors,tags'
};
/**
* @TODO:
*
* We actually need to differentiate here between pages and posts controller for v2.
* Currently this API call is without context object and it works out of the box, because the v2 serializer
* only forces `page:true|false` if you send a content key.
*
* It's also a little tricky, because the v0.1 has no pages controller.
* Furthermore, the preview router is used for pages and posts and we just receive a uuid. How to know
* which controller to call? pages or posts?
*/
api.posts.read(params)
.then(function then(result) {
const post = result.posts[0];

View file

@ -33,6 +33,14 @@ function postLookup(postUrl, routerOptions, locals) {
/**
* Query database to find post.
*
* @TODO:
*
* We actually need to differentiate here between pages and posts controller for v2.
* Currently this API call is without context object and it works out of the box, because the v2 serializer
* only forces `page:true|false` if you send a content key.
*
* It's also a little tricky, because the v0.1 has no pages controller.
*
* @deprecated: `author`, will be removed in Ghost 3.0
*/
return api.posts.read(_.extend(_.pick(params, 'slug', 'id'), {include: 'author,authors,tags'}))