wolyshaw 4 lat temu
rodzic
commit
c9c36091f5
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      src/store/modules/selects.js

+ 4 - 3
src/store/modules/selects.js

@@ -84,7 +84,7 @@ export default {
     },
     async setTeachers ({ commit, state }, force) {
       if ((!state.teachers.length || force === true) && !loadings.commit_teachers) {
-        loadings.commit_teachers = true
+        loadings.commit_teachers = getTeacher()
         try {
           state.teachersLoading =true
           const res = await getTeacher()
@@ -95,14 +95,15 @@ export default {
     },
     async setSchools ({ commit, state }, force) {
       if ((!state.schools.length || force === true) && !loadings.commit_schools) {
-        loadings.commit_schools = true
+        loadings.commit_schools = getSchool()
         try {
           state.schoolsLoading = true
-          const res = await getSchool()
+          const res = await loadings.commit_schools
           commit('commit_schools', res.data)
         } catch (error) { }
         loadings.commit_schools = false
       }
+      return loadings.commit_schools
     },
     async setVipGroupCategory ({ commit, state }, force) {
       if ((!state.vipGroupCategory.length || force === true) && !loadings.commit_vip_group_category) {