[tm@store] Added store

This commit is contained in:
Matej Glasnák committed 2023-02-15 15:56:24 +01:00
1 parent a1a410c54d
commit 774ca7b607
44 files changed
+989 -720

No files matched your search

+4 -25
View File
@@ -1,10 +1,11 @@
<template>
<W-loadable :content="teams">
<A-teams-table :teams="teams" @reloadData="_loadData" />
<A-teams-table :teams="teams" />
</W-loadable>
</template>
<script>
import { mapGetters } from 'vuex';
import ATeamsTable from './_components/a-teams-table.vue'
export default {
@@ -12,30 +13,8 @@ export default {
ATeamsTable
},
data() {
return {
teams: null
}
},
async created() {
await this._loadData()
},
mounted() {
this.$events.on('on-team-update', () => this._loadData())
},
methods: {
async _loadData() {
this.teams = null
try {
this.teams = await this.$axios.get_auth_data('v1/teams')
} catch (error) {
this.teams = {error}
}
}
computed: {
...mapGetters('tm', ['teams'])
}
}
</script>