Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenberg: enable v2 API requests #26639

Closed
1 of 2 tasks
vindl opened this issue Aug 10, 2018 · 1 comment
Closed
1 of 2 tasks

Gutenberg: enable v2 API requests #26639

vindl opened this issue Aug 10, 2018 · 1 comment
Assignees
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Enhancement

Comments

@vindl
Copy link
Member

vindl commented Aug 10, 2018

All of the API requests made from Gutenberg components to v2 API are currently noop-ed here. In order to make them work with actual API data we need to achieve a couple of things:

  • remove the noop middleware and correctly map all of the v2 endpoints to WP.com equivalents (e.g. /wp/v2/posts -> /wp/v2/sites/{siteSlug}/posts). I already added some code to handle the mapping, but we need to verify that there are no other edge cases that need to be mapped separately.
  • make authorized API request work. Once you remove the noop from above code you'll run into permission error (unauthorized request).

One thing that might be helpful with the above efforts is turning on the debug with localStorage.setItem( 'debug', 'calypso:gutenberg' );. This will display all of the currently attempted API calls in the console.

@vindl vindl added [Type] Enhancement [Goal] Gutenberg Working towards full integration with Gutenberg labels Aug 10, 2018
@vindl vindl added this to the Calypso Gutenberg Integration milestone Aug 10, 2018
@rodrigoi rodrigoi self-assigned this Aug 16, 2018
@gwwar
Copy link
Contributor

gwwar commented Sep 11, 2018

Let's close this one out and make more specific issues for the ones we're running into.

@gwwar gwwar closed this as completed Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Type] Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants