Skip to content

Commit

Permalink
optimised comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kirrg001 committed Dec 11, 2018
1 parent 0ca3ed8 commit fa24021
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions core/server/api/v2/utils/serializers/input/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ module.exports = {
browse(apiConfig, frame) {
debug('browse');

// CASE: the content api endpoints for pages forces the model layer to return static pages only.
// we have to enforce the filter.
/**
* CASE:
*
* - the content api endpoints for pages forces the model layer to return static pages only
* - we have to enforce the filter
*
* @TODO: https://github.com/TryGhost/Ghost/issues/10268
*/
if (frame.options.filter) {
frame.options.filter = `${frame.options.filter}+page:true`;
} else {
Expand Down
9 changes: 8 additions & 1 deletion core/server/api/v2/utils/serializers/input/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ module.exports = {
* - user exists? admin api access
*/
if (utils.isContentAPI(frame)) {
// CASE: the content api endpoints for posts should only return non page type resources
/**
* CASE:
*
* - the content api endpoints for posts should only return non page type resources
* - we have to enforce the filter
*
* @TODO: https://github.com/TryGhost/Ghost/issues/10268
*/
if (frame.options.filter) {
frame.options.filter = `${frame.options.filter}+page:false`;
} else {
Expand Down

0 comments on commit fa24021

Please sign in to comment.