0
Fork 0
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:
Simon Backx 2022-05-02 10:22:01 +02:00
parent 814f9043aa
commit 625635c6ed

View file

@ -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});