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() {
return {
reward: false,
cacheID: "",
cacheName: "",
rankingPoints: "",
end1: "Gut gemacht, Du hast alle Stationen dieses Cache gefunden. Dir wurden ",
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?
}
},
created() {
this.fetchData();
},
methods: {
fetchData() {
this.$axios.get('/api/allCaches')
@ -43,10 +49,11 @@
console.log(this.data);
console.log(response.data);
const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache));
this.data.cacheName = cache.name;
this.data.cachePoints = cache.rankingPoints;
this.cacheName = cache.name;
this.rankingPoints = cache.rankingPoints;
this.cacheID = this.$route.params.cache;
})
},
}
}
}
</script>

View File

@ -55,6 +55,11 @@ const routes = [
component: () => import("layouts/MyLayout.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/",
component: () => import("layouts/MyLayout.vue"),