Skip to content

Commit 9aab5da

Browse files
authored
In in GroupEdit/handleSubmit function - Fixing edit group fetch + utilizing unused variable (#13)
* fixed buggy put fetch issue * in previous commit, also utilized the csrftoken that was taken from state but not used previously
1 parent e3f447a commit 9aab5da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/src/GroupEdit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ class GroupEdit extends Component {
5454
event.preventDefault();
5555
const {item, csrfToken} = this.state;
5656

57-
await fetch('/api/group', {
57+
await fetch('/api/group' + (item.id ? '/' + item.id : '') , {
5858
method: (item.id) ? 'PUT' : 'POST',
5959
headers: {
60-
'X-XSRF-TOKEN': this.state.csrfToken,
60+
'X-XSRF-TOKEN': csrfToken,
6161
'Accept': 'application/json',
6262
'Content-Type': 'application/json'
6363
},

0 commit comments

Comments
 (0)