Skip to content

Commit 5f765d3

Browse files
authored
Merge pull request #28 from log-oscon/fix/wpapi-adapter-send-request-fix
Fixes sendRequest from wpapi adapter
2 parents 30400ad + a7a8eed commit 5f765d3

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ Some guidelines in reading this document:
1010
* Being that these are the early days of the repository, we have some code changes that were added directly and without much detail, for these we have a link to the commit instead of the PR.
1111
* Annotations starting with **[BC]** indicates breaking change.
1212

13-
## [new release]
13+
## [1.3.3]
14+
* WPAPI adapter: body of modifying requests wasn't being sent due a typo.
15+
16+
## [1.3.2]
1417
* Fix [#26](https://github.com/log-oscon/redux-wpapi/issues/26): Incoming partial resources shouldn't change the complete resource in cache to partial, just update it. ([#27](https://github.com/log-oscon/redux-wpapi/pull/27))
1518

1619
## [1.3.1]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-wpapi",
3-
"version": "1.3.1",
3+
"version": "1.3.3",
44
"description": "Wordpress integration Redux middleware based on node-wpapi.",
55
"main": "lib/index.js",
66
"files": [

src/adapters/wpapi.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export default class WPAPIAdapter {
288288
*/
289289
buildRequest({ request: requestBuilder, additionalParams }) {
290290
const wpRequest = requestBuilder(this.api);
291-
const { operation = 'get', ttl, ...body } = additionalParams;
291+
const { operation = 'get', ttl, body } = additionalParams;
292292

293293
return { wpRequest, operation, body, ttl };
294294
}
@@ -302,8 +302,8 @@ export default class WPAPIAdapter {
302302
* @param {Object} request Provided by consumer through the action `request` param
303303
* @return {Promise} The future result of the operation
304304
*/
305-
sendRequest({ wpRequest, operation }) {
305+
sendRequest({ wpRequest, operation, body }) {
306306
// Embeds any directly embeddable resource linked to current resource(s)
307-
return wpRequest.embed()[operation](wpRequest._body);
307+
return wpRequest.embed()[operation](body);
308308
}
309309
}

0 commit comments

Comments
 (0)