Parcourir la source

Merge branch 'master' of https://github.com/kerasus/palizvani-vite

ali il y a 2 ans
Parent
commit
e2a46f8e45

+ 13 - 6
src/components/Widgets/Classroom/ClassroomList/ClassroomList.vue

@@ -314,15 +314,22 @@ export default {
       this.getUnits()
     },
     getCategories () {
-      APIGateway.classroom.index({ per_page: 9999 })
-        .then(classroomList => {
-          this.loadSelectOptions('category', this.getSelectOptions(classroomList.list.list, 'id', 'title'))
-        })
-        .catch(() => {
+      APIGateway.unitCategory.index({ per_page: 9999, type: this.localOptions.classroomType })
+        .then((categories) => {
+          FormBuilderAssist.setAttributeByName(this.inputs, 'category', 'options', categories.list.list.map(item => {
+            return {
+              value: item.id,
+              label: item.title
+            }
+          }))
         })
+        .catch(() => {})
     },
     getUnits (selectedcategoryId) {
-      APIGateway.unit.index({ category: selectedcategoryId })
+      APIGateway.unit.index({
+        category: selectedcategoryId,
+        category__type: this.localOptions.classroomType
+      })
         .then(unitList => {
           this.loadSelectOptions('unit', this.getSelectOptions(unitList.list.list, 'id', 'title'))
         })

+ 1 - 1
src/components/Widgets/Other/ClassroomCarousel/ClassroomCarousel.vue

@@ -144,7 +144,7 @@ export default {
     getClassrooms () {
       this.classrooms.loading = true
       return APIGateway.classroom.index({
-        unit__category__type: 'EVENT'
+        unit__category__type: 'TRAINING'
       })
     }
   }