refresh on click for mins and summary

mic_level
Matt Huntington 3 years ago
parent 69fd271aec
commit 17d9e94341

@ -7,6 +7,13 @@
time_left:0 time_left:0
} }
}, },
methods: {
refresh(){
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then((response)=>{
this.time_left= response.data.time_left;
})
}
},
mounted() { mounted() {
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then((response)=>{ axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then((response)=>{
this.time_left= response.data.time_left; this.time_left= response.data.time_left;
@ -16,7 +23,7 @@
</script> </script>
<template> <template>
<h2>Mins Left to Practice Today</h2> <h2 @click="refresh">Mins Left to Practice Today</h2>
{{time_left}} {{time_left}}
</template> </template>

@ -7,6 +7,13 @@
categories:[] categories:[]
} }
}, },
methods: {
refresh(){
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary').then((response)=>{
this.categories = response.data
})
}
},
mounted() { mounted() {
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary').then((response)=>{ axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary').then((response)=>{
this.categories = response.data this.categories = response.data
@ -17,7 +24,7 @@
<template> <template>
<details> <details>
<summary><h2>Summary</h2></summary> <summary><h2 @click="refresh">Summary</h2></summary>
<table> <table>
<thead> <thead>
<tr> <tr>

Loading…
Cancel
Save