Created
July 24, 2019 00:58
-
-
Save jblz/63ce4207172f41fa94a186044a409863 to your computer and use it in GitHub Desktop.
Possible fix for https://github.com/Automattic/wp-calypso/pull/34447
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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