mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-01-20 20:01:22 +00:00
Merge pull request #6259 from Ocelot-Social-Community/default-categories-of-group
feat(webapp): default categories of group for posts in group
This commit is contained in:
commit
58b59051ce
@ -43,6 +43,14 @@ export default {
|
||||
selectedCategoryIds: this.existingCategoryIds,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
existingCategoryIds() {
|
||||
if (!this.selectedCategoryIds.length && this.existingCategoryIds.length) {
|
||||
this.selectedCategoryIds = this.existingCategoryIds
|
||||
this.$forceUpdate()
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
selectedCount() {
|
||||
return this.selectedCategoryIds.length
|
||||
|
||||
@ -177,6 +177,15 @@ export default {
|
||||
groupName() {
|
||||
return this.group && this.group.name
|
||||
},
|
||||
groupCategories() {
|
||||
return this.group && this.group.categories
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
groupCategories() {
|
||||
if (!this.formData.categoryIds.length && this.groupCategories)
|
||||
this.formData.categoryIds = this.groupCategories.map((cat) => cat.id)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user