Wolfgang Huß 2aa85d7b05 Merge branch '5059-epic-groups' of github.com:Ocelot-Social-Community/Ocelot-Social into 5344-add-group-members-management
# Conflicts:
#	backend/src/db/graphql/groups.js
#	backend/src/schema/resolvers/groups.js
#	webapp/components/Group/GroupCard.vue
#	webapp/components/Group/GroupForm.vue
#	webapp/components/Group/GroupTeaser.vue
#	webapp/graphql/groups.js
#	webapp/locales/de.json
#	webapp/locales/en.json
#	webapp/pages/group/edit/_id.vue
2022-09-23 15:04:49 +02:00

55 lines
1.3 KiB
Vue

<template>
<div>
<ds-section>
<h1 class="ds-heading ds-heading-h1">{{ $t('group.newGroup') }}</h1>
</ds-section>
<ds-space margin="large">
<ds-flex :width="{ base: '100%' }" gutter="base">
<ds-flex-item :width="{ base: '100%', md: 5 }">
<group-form @createGroup="createGroup" />
</ds-flex-item>
<ds-flex-item :width="{ base: '100%', md: 1 }">&nbsp;</ds-flex-item>
</ds-flex>
</ds-space>
</div>
</template>
<script>
import GroupForm from '~/components/Group/GroupForm'
import { createGroupMutation } from '~/graphql/groups.js'
export default {
components: {
GroupForm,
},
data() {
return {
createGroupData: {},
}
},
methods: {
async createGroup(value) {
const { name, about, description, groupType, actionRadius, locationName, categoryIds } = value
const variables = {
name,
about,
description,
groupType,
actionRadius,
locationName,
categoryIds,
}
try {
await this.$apollo.mutate({
mutation: createGroupMutation(),
variables,
})
this.$toast.success(this.$t('group.groupCreated'))
} catch (error) {
this.$toast.error(error.message)
}
},
},
}
</script>