mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fixed the {{#collection}}
helper
We were not passing the `slug` to the `apiOptions` so the posts were not correctly filtered, and on top of that the `collection` option had not been added to the allow list of the Posts Content API. With these two fixes the collection helper works as expected.
This commit is contained in:
parent
10b59adbbb
commit
66f7dcafab
2 changed files with 3 additions and 1 deletions
|
@ -113,6 +113,7 @@ module.exports = async function collection(slug, options) {
|
|||
// Parse the options we're going to pass to the API
|
||||
apiOptions = parseOptions(apiOptions);
|
||||
apiOptions.context = {member: data.member};
|
||||
apiOptions.collection = slug;
|
||||
|
||||
try {
|
||||
const response = await makeAPICall(resource, controllerName, action, apiOptions);
|
||||
|
|
|
@ -40,7 +40,8 @@ module.exports = {
|
|||
'order',
|
||||
'page',
|
||||
'debug',
|
||||
'absolute_urls'
|
||||
'absolute_urls',
|
||||
'collection'
|
||||
],
|
||||
validation: {
|
||||
options: {
|
||||
|
|
Loading…
Add table
Reference in a new issue