mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Updated frontend routing to include products for page/post
refs https://github.com/TryGhost/Team/issues/1071 - `products` relation is needed on post/page to tackle custom tiers visibility, this change attaches `products` as default include for frontend controllers
This commit is contained in:
parent
15d692dc01
commit
93596a1375
@ -18,7 +18,7 @@ module.exports = function emailPostController(req, res, next) {
|
|||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
uuid: req.params.uuid,
|
uuid: req.params.uuid,
|
||||||
include: 'authors,tags',
|
include: 'authors,tags,tiers',
|
||||||
context: {
|
context: {
|
||||||
member: res.locals.member
|
member: res.locals.member
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ module.exports = function previewController(req, res, next) {
|
|||||||
const params = {
|
const params = {
|
||||||
uuid: req.params.uuid,
|
uuid: req.params.uuid,
|
||||||
status: 'all',
|
status: 'all',
|
||||||
include: 'authors,tags'
|
include: 'authors,tags,tiers'
|
||||||
};
|
};
|
||||||
|
|
||||||
return api[res.routerOptions.query.controller]
|
return api[res.routerOptions.query.controller]
|
||||||
|
@ -13,7 +13,7 @@ function processQuery(query, locals) {
|
|||||||
// We override the `include` property for now, because the full data set is required anyway.
|
// We override the `include` property for now, because the full data set is required anyway.
|
||||||
if (_.get(query, 'resource') === 'posts' || _.get(query, 'resource') === 'pages') {
|
if (_.get(query, 'resource') === 'posts' || _.get(query, 'resource') === 'pages') {
|
||||||
_.extend(query.options, {
|
_.extend(query.options, {
|
||||||
include: 'authors,tags'
|
include: 'authors,tags,tiers'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ function entryLookup(postUrl, routerOptions, locals) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
include: 'authors,tags'
|
include: 'authors,tags,tiers'
|
||||||
};
|
};
|
||||||
|
|
||||||
options.context = {member: locals.member};
|
options.context = {member: locals.member};
|
||||||
|
@ -19,7 +19,7 @@ const queryDefaults = {
|
|||||||
*/
|
*/
|
||||||
const defaultQueryOptions = {
|
const defaultQueryOptions = {
|
||||||
options: {
|
options: {
|
||||||
include: 'authors,tags'
|
include: 'authors,tags,tiers'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user