Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jblz/63ce4207172f41fa94a186044a409863 to your computer and use it in GitHub Desktop.
Save jblz/63ce4207172f41fa94a186044a409863 to your computer and use it in GitHub Desktop.
diff --git a/client/state/data-layer/wpcom/checklist/index.js b/client/state/data-layer/wpcom/checklist/index.js
index bc37e168ee..4f1dd4a6e9 100644
--- a/client/state/data-layer/wpcom/checklist/index.js
+++ b/client/state/data-layer/wpcom/checklist/index.js
@@ -20,7 +20,10 @@ export const fetchChecklist = action =>
{
path: `/sites/${ action.siteId }/checklist`,
method: 'GET',
- apiVersion: '1.1',
+ apiNamespace: 'rest/v1.1',
+ query: {
+ http_envelope: 1,
+ },
},
action
);
@@ -48,6 +51,13 @@ export const receiveChecklistSuccess = ( action, receivedChecklist ) => {
const dispatchChecklistRequest = dispatchRequest( {
fetch: fetchChecklist,
+ fromApi: payload => {
+ if ( payload && payload.body ) {
+ // The desktop app doesn't unpack the response the same way as the web client
+ return payload.body;
+ }
+ return payload;
+ },
onSuccess: receiveChecklistSuccess,
onError: noop,
} );
@@ -57,7 +67,10 @@ export const updateChecklistTask = action =>
{
path: `/sites/${ action.siteId }/checklist`,
method: 'POST',
- apiVersion: '1.1',
+ apiNamespace: 'rest/v1.1',
+ query: {
+ http_envelope: 1,
+ },
body: { taskId: action.taskId },
},
action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment