added first error dialogs w/o any error specification

This commit is contained in:
rchrist 2019-04-18 18:04:40 +02:00
parent deb50cad9c
commit ddd21915c8
4 changed files with 21 additions and 9 deletions

View File

@ -159,9 +159,9 @@
console.log("POST api/createCache: " + response.statusText); console.log("POST api/createCache: " + response.statusText);
this.$store.commit('cacheCollector/RESET_NEW_CACHE'); this.$store.commit('cacheCollector/RESET_NEW_CACHE');
this.$router.push({ path: '/overview' }); this.$router.push({ path: '/overview' });
}) }).catch((error) => {
.catch((error) => { this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
}); });
} else { } else {
// TODO update existing Cache // TODO update existing Cache
} }

View File

@ -117,7 +117,9 @@
.then((response) => { .then((response) => {
console.log("Caches: " + this.caches); console.log("Caches: " + this.caches);
this.caches = response.data; this.caches = response.data;
}) }).catch((error) => {
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
})
}, },
addCache() { addCache() {
this.$router.push({path: `/cache`}) this.$router.push({path: `/cache`})
@ -129,7 +131,9 @@
this.$axios.delete('/api/deleteCache', {params: {cacheID: id}}) this.$axios.delete('/api/deleteCache', {params: {cacheID: id}})
.then((response) => { .then((response) => {
this.fetchAllCaches() this.fetchAllCaches()
}) }).catch((error) => {
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
})
}, },
startCache(cacheID) { startCache(cacheID) {
const userToken = JSON.parse(localStorage.getItem('userToken')).token; const userToken = JSON.parse(localStorage.getItem('userToken')).token;
@ -147,7 +151,9 @@
console.log(stationID); console.log(stationID);
//this.$router.push({path: `/station/${stationID}`}) //this.$router.push({path: `/station/${stationID}`})
this.$router.push({path: `/station/${cacheID}/${stationID}`}) this.$router.push({path: `/station/${cacheID}/${stationID}`})
}) }).catch((error) => {
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
})
} }
} }
} }

View File

@ -127,7 +127,9 @@
this.$axios.get('/api/getMyCaches', { params: {token}} ) this.$axios.get('/api/getMyCaches', { params: {token}} )
.then((response) => { .then((response) => {
this.startedCaches = response.data; this.startedCaches = response.data;
}); }).catch((error) => {
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
});
}, },
continueCache(cacheID) { continueCache(cacheID) {
} }

View File

@ -85,8 +85,12 @@
const stationView = response.data.find(station => station.id === Number(this.$route.params.id)); const stationView = response.data.find(station => station.id === Number(this.$route.params.id));
console.log(JSON.stringify(stationView)); console.log(JSON.stringify(stationView));
this.data.station = stationView; this.data.station = stationView;
}); }).catch((error) => {
}); this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
});
}).catch((error) => {
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: error })
});
} }
} }
} }