get it working

This commit is contained in:
Moriz Wahl 2023-04-25 13:27:25 +02:00
parent 3244f3f86d
commit 8df7d5d265
2 changed files with 265 additions and 264 deletions

View File

@ -45,9 +45,10 @@
},
watch: {
existingCategoryIds() {
console.log('existingCategoryIds', this.selectedCategoryIds)
if (!this.selectedCategoryIds.length)
if (!this.selectedCategoryIds.length && this.existingCategoryIds.length) {
this.selectedCategoryIds = this.existingCategoryIds
this.$forceUpdate()
}
},
},
computed: {

View File

@ -138,7 +138,7 @@
imageAspectRatio,
imageType,
imageBlurred,
categoryIds: categories ? categories.map((category) => category.id) : []
categoryIds: categories ? categories.map((category) => category.id) : [], // : this.groupCategories.map((cat) => cat.id) || [],
},
formSchema: {
title: { required: true, min: 3, max: 100 },
@ -178,13 +178,13 @@
return this.group && this.group.name
},
groupCategories() {
return this.group && this.group.categories
return this.group && this.group.categories // && group.categories.map((cat) => cat.id )
},
},
watch: {
groupCategories() {
console.log('groupCategories', this.groupCategories)
if (!this.formData.categoryIds && this.groupCategories) this.formData.categoryIds = this.groupCategories
if (!this.formData.categoryIds.length && this.groupCategories)
this.formData.categoryIds = this.groupCategories.map((cat) => cat.id)
},
},
methods: {