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

51 lines
1.0 KiB
Vue

<template>
<div>
<ds-container>
<group-form :group="group" :update="true" @updateGroup="updateGroup" />
</ds-container>
</div>
</template>
<script>
import GroupForm from '~/components/Group/GroupForm'
import { updateGroupMutation } from '~/graphql/groups.js'
export default {
components: {
GroupForm,
},
props: {
group: {
type: Object,
required: false,
default: () => ({}),
},
},
methods: {
async updateGroup(value) {
const { id, name, about, description, groupType, actionRadius, locationName, categoryIds } =
value
const variables = {
id,
name,
about,
description,
groupType,
actionRadius,
locationName,
categoryIds,
}
try {
await this.$apollo.mutate({
mutation: updateGroupMutation(),
variables,
})
this.$toast.success(this.$t('group.group-updated'))
} catch (error) {
this.$toast.error(error.message)
}
},
},
}
</script>