fixed register & continue cache
This commit is contained in:
parent
a97b3f1c91
commit
44086c630d
@ -49,7 +49,7 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-pr-sm reverse q-gutter-x-sm">
|
||||
<q-btn @click="continueCache(startedCache.id)" unelevated color="positive" stack icon="arrow_forward"
|
||||
<q-btn @click="continueCache(startedCache.cache.id)" unelevated color="positive" stack icon="arrow_forward"
|
||||
label="Fortfahren" size="sm"/>
|
||||
</q-item>
|
||||
</q-expansion-item>
|
||||
@ -245,6 +245,7 @@
|
||||
}
|
||||
this.$axios.get('/api/getMyCaches', {params: {token}})
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.startedCaches = response.data;
|
||||
}).catch((error) => {
|
||||
// Error
|
||||
@ -270,16 +271,23 @@
|
||||
})
|
||||
},
|
||||
continueCache(cacheID) {
|
||||
console.log("cacheID")
|
||||
console.log(cacheID)
|
||||
let currentCache;
|
||||
let params;
|
||||
if (localStorage.getItem('userToken')) {
|
||||
let params = {cacheID: cacheID};
|
||||
params.token = JSON.parse(localStorage.getItem('userToken')).token;
|
||||
this.$axios.get('/api/getCurrentStation', {params})
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch((error) => {
|
||||
});
|
||||
|
||||
this.$axios.get('/api/currentStation', {params})
|
||||
.then((response) => {
|
||||
})
|
||||
.catch((error) => {
|
||||
});
|
||||
}
|
||||
|
||||
this.$router.push({path: `/station/${cacheID}`})
|
||||
|
||||
//this.$router.push({path: `/station/${cacheID}`})
|
||||
},
|
||||
getPersonalRanking() {
|
||||
const name = JSON.parse(localStorage.getItem('userToken')).name;
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<!--<q-icon rounded color="cyan-14" name="location_on" size="3rem"/>-->
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label caption>{{ cache.description }}</q-item-label>
|
||||
<q-item-label caption v-html="cache.description"></q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side top class="self-center">
|
||||
|
||||
@ -50,7 +50,6 @@
|
||||
label="Sign up"
|
||||
color="primary"
|
||||
class="full-width"
|
||||
type="submit"
|
||||
@click="register()"
|
||||
unelevated
|
||||
/>
|
||||
|
||||
@ -55,8 +55,11 @@
|
||||
cacheID: "",
|
||||
cacheName: "",
|
||||
//cache: null,
|
||||
cache: null,
|
||||
station: null,
|
||||
cache: {
|
||||
name: "",
|
||||
stationen: [],
|
||||
},
|
||||
station: {},
|
||||
|
||||
// Following Params belong to QR-Code Scanner
|
||||
askForPermission: true,
|
||||
|
||||
@ -606,7 +606,9 @@ public class Controller {
|
||||
return ResponseEntity.status(200).body("Ok");
|
||||
}
|
||||
|
||||
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
||||
@RequestMapping("/api/getCurrentStation")
|
||||
@ResponseBody
|
||||
public ResponseEntity getStationFromUserAndCache(@RequestParam String token, @RequestParam String cacheID){
|
||||
|
||||
// verify user
|
||||
@ -641,6 +643,7 @@ public class Controller {
|
||||
return ResponseEntity.status(200).body(bearbeitetRepository.findByUserAndCache(user, cache));
|
||||
}
|
||||
|
||||
@CrossOrigin(origins = "*", allowedHeaders = "*") // only for dev purpose
|
||||
@RequestMapping("/api/hello")
|
||||
public ResponseEntity hello(@RequestParam String name) {
|
||||
return ResponseEntity.status(200).body(userRepository.getRankingPlaceFromUser(name));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user