Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Distlist/List.vue
Show All 37 Lines | |||||
<script> | <script> | ||||
export default { | export default { | ||||
data() { | data() { | ||||
return { | return { | ||||
lists: [] | lists: [] | ||||
} | } | ||||
}, | }, | ||||
created() { | created() { | ||||
// TODO: Find a way to do this in some more global way. Note that it cannot | |||||
// be done in the vue-router, but maybe the app component? | |||||
if (!this.$root.hasPermission('distlists')) { | |||||
this.$root.errorPage(404) | |||||
return | |||||
} | |||||
this.$root.startLoading() | this.$root.startLoading() | ||||
axios.get('/api/v4/groups') | axios.get('/api/v4/groups') | ||||
.then(response => { | .then(response => { | ||||
this.$root.stopLoading() | this.$root.stopLoading() | ||||
this.lists = response.data | this.lists = response.data | ||||
}) | }) | ||||
.catch(this.$root.errorHandler) | .catch(this.$root.errorHandler) | ||||
} | } | ||||
} | } | ||||
</script> | </script> |