mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added tag filter to newsletter resources module
refs https://github.com/TryGhost/Team/issues/1572 When fetching the newsletters, other resources were included. Now we filter on the newsletter tag so we only include newsletter and not normal resources.
This commit is contained in:
parent
814f9043aa
commit
625635c6ed
1 changed files with 2 additions and 1 deletions
|
@ -29,7 +29,8 @@ export default class Newsletter extends Component {
|
|||
const order = encodeURIComponent('published_at DESC');
|
||||
const key = encodeURIComponent(API_KEY);
|
||||
const limit = encodeURIComponent(NEWSLETTER_COUNT);
|
||||
let response = yield fetch(`${API_URL}/ghost/api/content/posts/?limit=${limit}&order=${order}&key=${key}&include=none`);
|
||||
const filter = encodeURIComponent('tag:newsletter');
|
||||
let response = yield fetch(`${API_URL}/ghost/api/content/posts/?limit=${limit}&order=${order}&key=${key}&include=none&filter=${filter}`);
|
||||
if (!response.ok) {
|
||||
// eslint-disable-next-line
|
||||
console.error('Failed to fetch newsletters', {response});
|
||||
|
|
Loading…
Add table
Reference in a new issue