This repository was archived by the owner on Dec 15, 2020. It is now read-only.
Commit 06eec59
Copy body data for PATCH when sending request.
Summary:
## Motivation
Solves the issue outlined in #218
When `PATCH`ing, the body of the request is not sent.
## Test Plan
Inside of a `componentDidMount` or some event handler in your react-vr codebase, add the following code:
```js
const payload = {
data: {
id: 'de0db600-9a0a-416d-b42b-a19d31aad039',
attributes: {
field_rotation: '-96',
field_rotation_x: '10',
},
},
};
fetch(`http://httpbin.org/patch`, {
method: 'patch',
body: JSON.stringify(payload),
headers: {
"Content-Type": "application/vnd.api+json"
}
})
.then(res => res.json())
.then(console.log)
```
In the console, you should see
<img width="961" alt="react-vr-body-pr-success" src="https://cloud.githubusercontent.com/assets/1127238/26806183/6c97446c-4a04-11e7-9cdb-cba70b0b8def.png">
Thank you for all of your hard work on this project. ❤️ 😄
Closes #219
Reviewed By: amberroy
Differential Revision: D5190034
Pulled By: amberroy
fbshipit-source-id: 2200ede1 parent a535145 commit 06eec59
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments