Minor changes to CacheEnd

This commit is contained in:
Katharina Will 2019-04-24 10:10:02 +02:00
parent 6f6fa8a0b0
commit 582edef020
2 changed files with 15 additions and 3 deletions

View File

@ -25,6 +25,9 @@
data() { data() {
return { return {
reward: false, reward: false,
cacheID: "",
cacheName: "",
rankingPoints: "",
end1: "Gut gemacht, Du hast alle Stationen dieses Cache gefunden. Dir wurden ", end1: "Gut gemacht, Du hast alle Stationen dieses Cache gefunden. Dir wurden ",
end2: " Punkte gutgeschrieben." //TODO Punkte wirklich gutschreiben, ggf. Cache auf erledigt setzen end2: " Punkte gutgeschrieben." //TODO Punkte wirklich gutschreiben, ggf. Cache auf erledigt setzen
} }
@ -34,6 +37,9 @@
return localStorage.getItem('userToken'); //TODO Methode umschreiben --> funktioniert das? return localStorage.getItem('userToken'); //TODO Methode umschreiben --> funktioniert das?
} }
}, },
created() {
this.fetchData();
},
methods: { methods: {
fetchData() { fetchData() {
this.$axios.get('/api/allCaches') this.$axios.get('/api/allCaches')
@ -43,10 +49,11 @@
console.log(this.data); console.log(this.data);
console.log(response.data); console.log(response.data);
const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache)); const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache));
this.data.cacheName = cache.name; this.cacheName = cache.name;
this.data.cachePoints = cache.rankingPoints; this.rankingPoints = cache.rankingPoints;
this.cacheID = this.$route.params.cache;
}) })
} },
} }
} }
</script> </script>

View File

@ -55,6 +55,11 @@ const routes = [
component: () => import("layouts/MyLayout.vue"), component: () => import("layouts/MyLayout.vue"),
children: [{ path: "", component: () => import("pages/CacheStart.vue") }] children: [{ path: "", component: () => import("pages/CacheStart.vue") }]
}, },
{
path: "/CacheEnd/:cache/",
component: () => import("layouts/MyLayout.vue"),
children: [{ path: "", component: () => import("pages/CacheEnd.vue") }]
},
{ {
path: "/profile/", path: "/profile/",
component: () => import("layouts/MyLayout.vue"), component: () => import("layouts/MyLayout.vue"),