From bac0a31fd34f9eb0ac1044eadcf8749a2748b175 Mon Sep 17 00:00:00 2001 From: Timo Volkmann Date: Tue, 30 Apr 2019 15:30:50 +0200 Subject: [PATCH] fixed bugs in cache creation and processing --- frontend/src/layouts/MyLayout.vue | 1 + frontend/src/pages/Profile.vue | 11 ++++++++--- frontend/src/pages/StationView.vue | 24 ++++++++---------------- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/frontend/src/layouts/MyLayout.vue b/frontend/src/layouts/MyLayout.vue index 3bc0414..f677cad 100644 --- a/frontend/src/layouts/MyLayout.vue +++ b/frontend/src/layouts/MyLayout.vue @@ -44,6 +44,7 @@ - +
-

{{ data.cacheName }}

+

{{ cache.name }}

Station {{ showCacheProgress }}

-

{{ data.station.description }}

+

{{ station.description }}

@@ -54,19 +54,9 @@ //code: "", cacheID: "", cacheName: "", + //cache: null, cache: null, - data: { - cacheId: 22, - cacheName: "Wasserfall Cache", - station: { - id: 22, - description: "Ein kleines winterliches Schlaginstrument. Welche Blume ist damit gemeint?", - longitude: 9.206628, - lattitude: 49.147734, - code: 213812, - solution: "Schneeglöckchen" - } - }, + station: null, // Following Params belong to QR-Code Scanner askForPermission: true, @@ -107,13 +97,15 @@ this.$axios.get('/api/allCaches') .then((response) => { console.log("/api/allCaches"); - console.log(JSON.stringify(this.data)); - console.log(this.data); console.log(response.data); const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache)); this.cache = cache; + this.station = cache.stationen.find(station => station.id === Number(this.$route.params.id)); this.cacheName = cache.name; this.cacheID = this.$route.params.cache; + console.log(JSON.stringify(this.cache)); + console.log(JSON.stringify(this.station)); + console.log(this.cache); }) },