Skip to content

Commit

Permalink
Merge pull request #12135 from Automattic/fix/data-layer-post
Browse files Browse the repository at this point in the history
Data Layer: Fix POSTing data in data layer
  • Loading branch information
donnapep committed Mar 16, 2017
2 parents 1ddbd43 + a6412fb commit 856f143
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/state/data-layer/wpcom-http/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { WPCOM_HTTP_REQUEST } from 'state/action-types';
*/
export const http = ( {
apiVersion = 'v1',
body = {},
body,
method,
path,
query = {},
Expand All @@ -35,7 +35,7 @@ export const http = ( {
body,
method,
path,
query: { ...query, apiVersion },
query: method === 'GET' && { ...query, apiVersion },
formData,
onSuccess: onSuccess || action,
onFailure: onFailure || action,
Expand Down
4 changes: 2 additions & 2 deletions client/state/data-layer/wpcom-http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const fetcherMap = method => get( {

export const successMeta = data => ( { meta: { dataLayer: { data } } } );
export const failureMeta = error => ( { meta: { dataLayer: { error } } } );
export const progressMeta = ( { size: total, loaded } ) => ( { meta: { dataLayer: { progress: { total, loaded } } } } );
export const progressMeta = ( { total, loaded } ) => ( { meta: { dataLayer: { progress: { total, loaded } } } } );

const queueRequest = ( { dispatch }, action, next ) => {
const {
body = {},
body,
formData,
method: rawMethod,
onSuccess,
Expand Down

0 comments on commit 856f143

Please sign in to comment.