|
|
|
|
@ -1,30 +1,23 @@
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
<script setup>
|
|
|
|
|
import { onMounted, ref } from 'vue'
|
|
|
|
|
const emit = defineEmits(['update'])
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
props: ['setWorkingCategory'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
categories:[]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
refresh(){
|
|
|
|
|
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary').then((response)=>{
|
|
|
|
|
this.categories = response.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary').then((response)=>{
|
|
|
|
|
this.categories = response.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const categories = ref([])
|
|
|
|
|
|
|
|
|
|
const loadData = async () => {
|
|
|
|
|
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'summary')
|
|
|
|
|
categories.value = await response.json()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onMounted(loadData)
|
|
|
|
|
|
|
|
|
|
const setWorkingCategory = (category) => {
|
|
|
|
|
emit('update', category.category_id)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<h2 @click="refresh">Summary</h2>
|
|
|
|
|
<h2 @click="loadData">Summary</h2>
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
@ -46,6 +39,3 @@
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
</style>
|
|
|
|
|
|