diff --git a/webapp/components/GroupForm/GroupForm.vue b/webapp/components/GroupForm/GroupForm.vue index 703adc45c..2cbc67464 100644 --- a/webapp/components/GroupForm/GroupForm.vue +++ b/webapp/components/GroupForm/GroupForm.vue @@ -2,25 +2,25 @@
- + - + -
{{ name }}
-
{{ status }}
-
{{ description }}
+
{{ form.name }}
+
{{ form.status }}
+
{{ form.description }}
Reset form - Save group + Save group
@@ -38,24 +38,33 @@ export default { components: { CategoriesSelect, }, + props:{ + value: { + type: Object, + default: () => ({}), + required: true, + } + }, data() { return { - name: '', - status: '', - description: '', - disable: false, + form: { + name: '', + status: '', + description: '', + disable: false, + } + } }, methods: { submit() { - console.log('handleSubmit') - }, - handleSubmit() { - console.log('handleSubmit') + console.log('submit', this.form) + this.$emit('createGroup', this.form) + }, reset() { - console.log('handleSubmit') + console.log('reset') }, }, } diff --git a/webapp/graphql/groups.js b/webapp/graphql/groups.js new file mode 100644 index 000000000..c41f06e4d --- /dev/null +++ b/webapp/graphql/groups.js @@ -0,0 +1,107 @@ +import gql from 'graphql-tag' + +// ------ mutations + +export const createGroupMutation = gql` + mutation ( + $id: ID + $name: String! + $slug: String + $about: String + $description: String! + $groupType: GroupType! + $actionRadius: GroupActionRadius! + $categoryIds: [ID] + ) { + CreateGroup( + id: $id + name: $name + slug: $slug + about: $about + description: $description + groupType: $groupType + actionRadius: $actionRadius + categoryIds: $categoryIds + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + groupType + actionRadius + myRole + # Wolle: owner { + # name + # } + } + } +` + +// ------ queries + +export const groupQuery = gql` + query ( + $isMember: Boolean + $id: ID + $name: String + $slug: String + $createdAt: String + $updatedAt: String + $about: String + $description: String + # $groupType: GroupType!, + # $actionRadius: GroupActionRadius!, + # $categoryIds: [ID] + $locationName: String + $first: Int + $offset: Int + $orderBy: [_GroupOrdering] + $filter: _GroupFilter + ) { + Group( + isMember: $isMember + id: $id + name: $name + slug: $slug + createdAt: $createdAt + updatedAt: $updatedAt + about: $about + description: $description + # groupType: $groupType + # actionRadius: $actionRadius + # categoryIds: $categoryIds + locationName: $locationName + first: $first + offset: $offset + orderBy: $orderBy + filter: $filter + ) { + id + name + slug + createdAt + updatedAt + disabled + deleted + about + description + groupType + actionRadius + myRole + categories { + id + slug + name + icon + } + # Wolle: owner { + # name + # } + } + } +` diff --git a/webapp/pages/group/create.vue b/webapp/pages/group/create.vue index e82fadd6e..c76be5360 100644 --- a/webapp/pages/group/create.vue +++ b/webapp/pages/group/create.vue @@ -2,7 +2,7 @@
- +   @@ -14,11 +14,49 @@