Skip to content

Commit

Permalink
Added TODO's for entry and preview controller
Browse files Browse the repository at this point in the history
refs #9866
  • Loading branch information
kirrg001 committed Oct 18, 2018
1 parent cbf2817 commit d8a7edd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/server/services/routing/controllers/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 8 additions & 0 deletions core/server/services/routing/helpers/post-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}))
Expand Down

0 comments on commit d8a7edd

Please sign in to comment.