mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
new group mutation with correct data
This commit is contained in:
parent
9715243454
commit
5f7b1c9094
@ -18,10 +18,16 @@
|
||||
icon="user"
|
||||
v-model="formData.status"
|
||||
label="Sichtbarkeit"
|
||||
:options="['offen', 'geschlossen', 'geheim']"
|
||||
:options="['public', 'close', 'hidden']"
|
||||
placeholder="Status ..."
|
||||
></ds-select>
|
||||
|
||||
<ds-input
|
||||
v-model="formData.about"
|
||||
label="Kurzbeschreibung"
|
||||
rows="3"
|
||||
></ds-input>
|
||||
|
||||
<ds-input
|
||||
v-model="formData.description"
|
||||
label="Beschreibung"
|
||||
@ -29,6 +35,14 @@
|
||||
rows="3"
|
||||
></ds-input>
|
||||
|
||||
<ds-select
|
||||
icon="card"
|
||||
v-model="formData.radius"
|
||||
label="Radius"
|
||||
:options="['local', 'regional', 'global']"
|
||||
placeholder="Radius ..."
|
||||
></ds-select>
|
||||
|
||||
<categories-select
|
||||
v-if="categoriesActive"
|
||||
model="formData.categoryIds"
|
||||
@ -72,20 +86,24 @@ export default {
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const { name, status, description, categories } = this.group
|
||||
const { name, status, about, description, radius, categories } = this.group
|
||||
return {
|
||||
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
||||
disabled: false,
|
||||
formData: {
|
||||
name: name || '',
|
||||
status: status || '',
|
||||
about: about || '',
|
||||
description: description || '',
|
||||
radius: radius || '',
|
||||
categoryIds: categories ? categories.map((category) => category.id) : [],
|
||||
},
|
||||
formSchema: {
|
||||
name: { required: true, min: 3, max: 100 },
|
||||
description: { required: true },
|
||||
status: { required: true },
|
||||
about: { required: true },
|
||||
description: { required: true },
|
||||
radius: { required: true },
|
||||
categoryIds: {
|
||||
type: 'array',
|
||||
required: this.categoriesActive,
|
||||
|
||||
@ -28,17 +28,19 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async createGroup(form) {
|
||||
console.log("createGroup", form)
|
||||
console.log("createGroup form.categoryIds", form.categoryIds)
|
||||
console.log("createGroup form.radius", form.radius)
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: createGroupMutation,
|
||||
variables: {
|
||||
name: 'Gruppenname',
|
||||
about: 'About',
|
||||
description:
|
||||
'Description Description Description Description Description Description Description Description Description Description Description Description ',
|
||||
groupType: 'public',
|
||||
actionRadius: 'regional',
|
||||
categoryIds: ['cat15', 'cat5', 'cat1'],
|
||||
name: form.name,
|
||||
about: form.about,
|
||||
description: form.description,
|
||||
groupType: form.status,
|
||||
actionRadius: form.radius,
|
||||
categoryIds: form.formData.categoryIds,
|
||||
},
|
||||
update: (_, { data: { createGroupData } }) => {
|
||||
// const { sendNotificationEmails } = createGroup
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user