mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
# 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
55 lines
1.3 KiB
Vue
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 }"> </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>
|