diff options
author | therealbobo | 2020-09-17 08:42:00 +0000 |
---|---|---|
committer | therealbobo | 2020-09-17 08:42:00 +0000 |
commit | 9063c5d4d5b04e4c7f4e689c9246c4b37b72ec68 (patch) | |
tree | e59da614e29386daf53f3930851566b00b49e95a /frontend/src/views/Services.js | |
parent | 4cfdf6e2dfe9184e988a145495e072571d512cdc (diff) | |
parent | 98355cdf838d8c18e9a28176ae7a847770545395 (diff) |
conflicts fixed and merge
Diffstat (limited to 'frontend/src/views/Services.js')
-rw-r--r-- | frontend/src/views/Services.js | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/frontend/src/views/Services.js b/frontend/src/views/Services.js index b95b01c..0de021f 100644 --- a/frontend/src/views/Services.js +++ b/frontend/src/views/Services.js @@ -64,12 +64,23 @@ class Services extends Component { saveService() { if (this.state.portValid && this.state.nameValid) { - axios.put("/api/services", { - name: this.state.name, - port: this.state.port, - color: this.state.color, - notes: this.state.notes - }); + const requestOptions = { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + color: this.state.color, + name: this.state.name, + notes: this.state.notes, + port: this.state.port, + }) + }; + + + fetch('/api/services', requestOptions) + .then(function(response){ + console.log(response); + } + ); this.newService(); this.loadServices(); |