diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue index 868f397..815d112 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Cache.vue @@ -4,7 +4,8 @@

{{ isNewCache ? "Neuen Cache erstellen" : "Cache bearbeiten"}}

- +

Beschreibung

- +
+ +
+ • Name muss mindestens 3 Zeichen lang sein. +
+
+ • Punktewert des Caches muss 1-9999 betragen. +
+
+ • Cachebeschreibung muss ausgefüllt sein und sollte sinnvollen Text enthalten. +
+
+ • Cachebelohnung muss ausgefüllt sein und sollte einen netten Text enthalten. +
+
+ • Es muss mindestens eine Station zum Cache hinzugefügt werden. +
+ +
+
+ +
@@ -112,6 +134,9 @@ return { scrolldown: false, isNewCache: this.$route.params.id === undefined, + showTooltip: false, + tooltipInfoText: "", + validateInputBool: false, //tempCache: {}, } }, @@ -258,7 +283,19 @@ }, validateEverything() { return this.validateRankingPoints(); - } + }, + validateInput() { + if (this.computedCache.name.length > 2 + && (this.computedCache.rankingPoints > 0 && this.computedCache.rankingPoints <= 9999) + && this.computedCache.description.length > 0 + && this.computedCache.reward.rewardDescription.length > 0 + && this.computedCache.stationen.length > 0) { + this.validateInputBool = false; + this.saveCache(); + return; + } + this.validateInputBool = true; + }, }, computed: { computedCache: { diff --git a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Profile.vue b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Profile.vue index 9e19de5..04db0d4 100644 --- a/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Profile.vue +++ b/labswp_2019_sose_geocaching_frontend/frontend/src/pages/Profile.vue @@ -566,7 +566,7 @@ const token = JSON.parse(localStorage.getItem('userToken')).token; newAdmin.roles.role = "ADMIN"; JSON.stringify(newAdmin); - this.$axios.patch(process.env.USER_API, '/account', newAdmin, { + this.$axios.patch(process.env.USER_API + '/account', newAdmin, { headers: { 'Authorization': 'Bearer ' + token, }