Skip to content

Commit

Permalink
fix: show all saved post types in specific posts field (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Sep 3, 2021
1 parent 9637d89 commit 42c25a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/query-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ class QueryControls extends Component {
} );
};
fetchSavedPosts = postIDs => {
const { postType } = this.props;
const restUrl = window.newspack_blocks_data.posts_rest_url;
return apiFetch( {
path: addQueryArgs( '/wp/v2/posts', {
url: addQueryArgs( restUrl, {
per_page: 100,
include: postIDs.join( ',' ),
_fields: 'id,title',
post_type: postType,
} ),
} ).then( function ( posts ) {
return posts.map( post => ( {
Expand Down

0 comments on commit 42c25a9

Please sign in to comment.