diff --git a/src/components/GroupManager.vue b/src/components/GroupManager.vue new file mode 100644 index 0000000..bb9612d --- /dev/null +++ b/src/components/GroupManager.vue @@ -0,0 +1,56 @@ + + + diff --git a/src/composables/useGroups.ts b/src/composables/useGroups.ts new file mode 100644 index 0000000..d2de8d0 --- /dev/null +++ b/src/composables/useGroups.ts @@ -0,0 +1,30 @@ +import axios from 'axios' +import { ref } from 'vue' + +interface Group { + description: string + group: string +} + +interface ListGroupsResponse { + groups: Array +} + +export function useGroups() { + const error = ref() + const loading = ref(true) + const data = ref() + + async function fetch() { + try { + data.value = (await axios.post('/api/list-groups', {})).data + } catch (reason: any) { + error.value = reason + console.log(reason) + } finally { + loading.value = false + } + } + + return { data, error, loading, fetch } +} diff --git a/src/views/UserManager.vue b/src/views/UserManager.vue index 8ea3e07..77c3cd9 100644 --- a/src/views/UserManager.vue +++ b/src/views/UserManager.vue @@ -6,6 +6,7 @@ import ContentPage from '@/components/ContentPage.vue' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' import { faPlusCircle } from '@fortawesome/free-solid-svg-icons' import axios from 'axios' +import GroupManager from '@/components/GroupManager.vue' interface User { display_name: string @@ -84,15 +85,7 @@ onMounted(() => {
-
- - - {{ $t('user_manager.add_group') }} - - -
+