mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
feat(webapp): group categories on posts
This commit is contained in:
parent
e2667a1a98
commit
3244f3f86d
@ -43,6 +43,13 @@ export default {
|
||||
selectedCategoryIds: this.existingCategoryIds,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
existingCategoryIds() {
|
||||
console.log('existingCategoryIds', this.selectedCategoryIds)
|
||||
if (!this.selectedCategoryIds.length)
|
||||
this.selectedCategoryIds = this.existingCategoryIds
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
selectedCount() {
|
||||
return this.selectedCategoryIds.length
|
||||
|
||||
@ -138,7 +138,7 @@ export default {
|
||||
imageAspectRatio,
|
||||
imageType,
|
||||
imageBlurred,
|
||||
categoryIds: categories ? categories.map((category) => category.id) : [],
|
||||
categoryIds: categories ? categories.map((category) => category.id) : []
|
||||
},
|
||||
formSchema: {
|
||||
title: { required: true, min: 3, max: 100 },
|
||||
@ -177,6 +177,15 @@ export default {
|
||||
groupName() {
|
||||
return this.group && this.group.name
|
||||
},
|
||||
groupCategories() {
|
||||
return this.group && this.group.categories
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
groupCategories() {
|
||||
console.log('groupCategories', this.groupCategories)
|
||||
if (!this.formData.categoryIds && this.groupCategories) this.formData.categoryIds = this.groupCategories
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user