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