mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
fix updateGroup function
This commit is contained in:
parent
fe6ad2cff3
commit
fb9cf7559e
@ -2,6 +2,8 @@
|
||||
<div>
|
||||
<ds-container>
|
||||
update: {{ update }}
|
||||
<br />
|
||||
this group: {{this.group}}
|
||||
<ds-form
|
||||
class="group-form"
|
||||
ref="groupForm"
|
||||
@ -89,6 +91,7 @@ export default {
|
||||
},
|
||||
},
|
||||
data() {
|
||||
console.log('GroupForm group', this.group)
|
||||
const { name, groupType, about, description, actionRadius, categories } = this.group
|
||||
return {
|
||||
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
||||
@ -123,9 +126,10 @@ export default {
|
||||
|
||||
methods: {
|
||||
submit() {
|
||||
console.log('submit', this.formData)
|
||||
console.log('submit', this.formData)
|
||||
const { name, about, description, actionRadius, categoryIds } = this.formData
|
||||
this.update
|
||||
? this.$emit('updateGroup', this.formData)
|
||||
? this.$emit('updateGroup', { name, about, description, actionRadius, categoryIds, id: this.group.id })
|
||||
: this.$emit('createGroup', this.formData)
|
||||
},
|
||||
reset() {
|
||||
|
||||
@ -55,7 +55,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
editGroup(formData) {
|
||||
console.log('GroupListedit group', formData)
|
||||
this.$router.push({ path: `/group/edit/${formData.id}` })
|
||||
},
|
||||
deleteGroup() {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
_id groupe page
|
||||
<div>{{ $route.params }}</div>
|
||||
<nuxt-link :to="{ name: 'group-create' }">
|
||||
bearbeiten
|
||||
<ds-icon name="ellipsis-v"></ds-icon>
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
<template>
|
||||
<ds-flex gutter="small">
|
||||
{{ $router }}
|
||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||
<ds-menu :routes="routes" :is-exact="() => true" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
||||
{{ group }}
|
||||
<transition name="slide-up" appear>
|
||||
<group-form @updateGroup="updateGroup" :group="group" :update="true" />
|
||||
</transition>
|
||||
@ -47,9 +45,6 @@ export default {
|
||||
user: 'auth/user',
|
||||
}),
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
async asyncData(context) {
|
||||
console.log('asyncData start')
|
||||
const {
|
||||
@ -75,23 +70,12 @@ export default {
|
||||
return { group }
|
||||
},
|
||||
methods: {
|
||||
async updateGroup(form, context) {
|
||||
const {
|
||||
params: { id },
|
||||
} = context
|
||||
async updateGroup(value) {
|
||||
console.log('updateGroup form', value)
|
||||
try {
|
||||
await this.$apollo.mutate({
|
||||
mutation: updateGroupMutation,
|
||||
variables: {
|
||||
id: id,
|
||||
name: form.name,
|
||||
about: form.about,
|
||||
description: form.description,
|
||||
// groupType: form.groupType,
|
||||
actionRadius: form.actionRadius,
|
||||
categoryIds: form.categoryIds,
|
||||
// locationName: ''
|
||||
},
|
||||
variables: value,
|
||||
update: (_, { data: { updateGroupData } }) => {
|
||||
// const { sendNotificationEmails } = createGroup
|
||||
// this.setCreateGroup({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user