Просмотр исходного кода

Revert "ارسال کتگوری آی دی به جای آبجکت آن"

This reverts commit c8ccd5f6
HgH 2 лет назад
Родитель
Сommit
1013f4fd14
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      src/components/FormBuilderCustumComponents/ContentCategorySelector.vue

+ 4 - 3
src/components/FormBuilderCustumComponents/ContentCategorySelector.vue

@@ -96,7 +96,7 @@ export default {
       this.subCategory = null
       this.subCategory = null
       this.subCategoryOptions = []
       this.subCategoryOptions = []
       if (!newValue.item.children) {
       if (!newValue.item.children) {
-        this.$emit('update:value', newValue.value.id)
+        this.$emit('update:value', newValue.value)
         return
         return
       }
       }
       this.subCategoryOptions = newValue.item.children.map(item => {
       this.subCategoryOptions = newValue.item.children.map(item => {
@@ -111,7 +111,7 @@ export default {
       this.bakhshCategory = null
       this.bakhshCategory = null
       this.bakhshCategoryOptions = []
       this.bakhshCategoryOptions = []
       if (!newValue.item.children) {
       if (!newValue.item.children) {
-        this.$emit('update:value', newValue.value.id)
+        this.$emit('update:value', newValue.value)
         return
         return
       }
       }
       this.bakhshCategoryOptions = newValue.item.children.map(item => {
       this.bakhshCategoryOptions = newValue.item.children.map(item => {
@@ -123,7 +123,7 @@ export default {
       })
       })
     },
     },
     bakhshCategory (newValue) {
     bakhshCategory (newValue) {
-      const categoryId = newValue ? newValue.value.id : null
+      const categoryId = newValue ? newValue.value : null
       this.$emit('update:value', categoryId)
       this.$emit('update:value', categoryId)
     }
     }
   },
   },
@@ -179,6 +179,7 @@ export default {
               value: item.id
               value: item.id
             }
             }
           })
           })
+
           if (this.value?.parent?.parent?.id && this.value.id) {
           if (this.value?.parent?.parent?.id && this.value.id) {
             this.$nextTick(() => {
             this.$nextTick(() => {
               this.setMainCategory()
               this.setMainCategory()