Skip to content

Commit

Permalink
List Reusable Blocks: Provide context to post request
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Oct 19, 2018
1 parent 9c1da9e commit 0235f5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/list-reusable-blocks/src/utils/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { download } from './file';
* @param {number} id
*/
async function exportReusableBlock( id ) {
const postType = await apiFetch( { path: `/wp/v2/types/wp_block?context=edit` } );
const post = await apiFetch( { path: `/wp/v2/${ postType.rest_base }/${ id }` } );
const postType = await apiFetch( { path: `/wp/v2/types/wp_block` } );
const post = await apiFetch( { path: `/wp/v2/${ postType.rest_base }/${ id }?context=edit` } );
const title = post.title.raw;
const content = post.content.raw;
const fileContent = JSON.stringify( {
Expand Down

0 comments on commit 0235f5d

Please sign in to comment.