In order for editor users to view drafts on teach.m.o, the editor must be authenticated with Calypso & WP.com's API (wp-api). Teach.m.o will use the react-wp-api-client in order to retrieve content from wp-api. By default, this content will be published content. We need to have a switch for showing latest draft content so that the preview interface can trigger it. That switch can be added to the querystring. When ?preview=true appears in the teach.m.o querystring, we should load the latest draft content.
Tasks:
[x] Try to load a draft post on a new test page within wp-calypso
[x] Add a proxy route to wp-calypso that forwards requests to wp-api
[x] Make proxy route only work when user is authenticated
[x] Add code to react-wp-api-client that selectively loads from wp-calypso's proxy instead of wp-api directly when preview=true is set.
In order for editor users to view drafts on teach.m.o, the editor must be authenticated with Calypso & WP.com's API (
wp-api
). Teach.m.o will use the react-wp-api-client in order to retrieve content fromwp-api
. By default, this content will be published content. We need to have a switch for showing latest draft content so that the preview interface can trigger it. That switch can be added to the querystring. When?preview=true
appears in the teach.m.o querystring, we should load the latest draft content.Tasks: