Ocelot-Social/webapp/pages/my-groups.vue
2022-09-13 09:56:03 +02:00

45 lines
919 B
Vue

<template>
<div>
<h1 class="ds-heading ds-heading-h1">My Groups</h1>
<group-teaser />
<br />
<br />
<group-list :items="responseGroupListQuery" />
</div>
</template>
<script>
import GroupTeaser from '~/components/Group/GroupTeaser.vue'
import GroupList from '~/components/Group/GroupList.vue'
import { groupQuery } from '~/graphql/groups.js'
export default {
name: 'MyGroups',
components: {
GroupTeaser,
GroupList,
},
data() {
return {
responseGroupListQuery: [],
}
},
methods: {
async groupListQuery() {
try {
const response = await this.$apollo.query({
query: groupQuery,
})
this.responseGroupListQuery = response.data.Group
} catch (error) {
this.responseGroupListQuery = []
} finally {
this.pending = false
}
},
},
created() {
this.groupListQuery()
},
}
</script>