aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/views/Services.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend/src/views/Services.js b/frontend/src/views/Services.js
index b95b01c..9f0fbd2 100644
--- a/frontend/src/views/Services.js
+++ b/frontend/src/views/Services.js
@@ -64,12 +64,33 @@ class Services extends Component {
saveService() {
if (this.state.portValid && this.state.nameValid) {
+ 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);
+ }
+ );
+
+ /*
axios.put("/api/services", {
name: this.state.name,
port: this.state.port,
color: this.state.color,
notes: this.state.notes
});
+ */
+
this.newService();
this.loadServices();