Skip to content

Commit

Permalink
Add http_envelope query argument explicitly.
Browse files Browse the repository at this point in the history
  • Loading branch information
southp committed Apr 10, 2018
1 parent b9b5a51 commit 99ea650
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion client/state/data-layer/wpcom/me/transactions/order/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ import fromApi from './from-api';
export const fetchOrderTransaction = action =>
http(
{
method: 'GET',
path: `/me/transactions/order/${ action.orderId }`,
method: 'GET',
apiNamespace: 'rest/v1',
// At the moment, we have to pass this explicitly for rest/v1 APIs.
// It is actually not ideal since it should work with or without http envelope.
query: {
http_envelope: 1,
},
},
action
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ describe( 'wpcom-api', () => {
expect( fetchOrderTransaction( action ) ).toEqual(
http(
{
method: 'GET',
path: `/me/transactions/order/${ action.orderId }`,
method: 'GET',
apiNamespace: 'rest/v1',
query: {
http_envelope: 1,
},
},
action
)
Expand Down

0 comments on commit 99ea650

Please sign in to comment.