diff --git a/frontend/src/pages/Cache.vue b/frontend/src/pages/Cache.vue index d61d98d..0c688b9 100644 --- a/frontend/src/pages/Cache.vue +++ b/frontend/src/pages/Cache.vue @@ -188,10 +188,10 @@ }, saveCache() { // commit to store, send to api, if success -> reset store + let cache = JSON.parse(JSON.stringify(this.computedCache)); + console.log(cache); + cache.stationen.push(this.computedEndstation); if (this.isNewCache) { - let cache = JSON.parse(JSON.stringify(this.computedCache)); - console.log(cache); - cache.stationen.push(this.computedEndstation); this.$axios.post('/api/createCache', cache) .then((response) => { @@ -222,7 +222,7 @@ this.$store.commit('dialog/NEW_MESSAGE_DIALOG', {message: msg, title: title,}); }) } else { - this.$axios.post('/api/editCache', cache) + this.$axios.put('/api/editCache', cache) .then((response) => { console.log("POST api/editCache: " + response.statusText); this.$store.commit('cacheCollector/RESET_NEW_CACHE');