({ state, dispatch, getters }, options = {})
| 211 | |
| 212 | // My Schools page |
| 213 | async fetchDataMySchools ({ state, dispatch, getters }, options = {}) { |
| 214 | await dispatch('schoolAdministrator/fetchTeachers', undefined, { root: true }) // fetches for me.id |
| 215 | |
| 216 | const fetchPromises = [] |
| 217 | const teachers = getters.getAdministratedTeachers |
| 218 | teachers.forEach((t) => { |
| 219 | fetchPromises.push(dispatch('userStats/fetchStatsForUser', t._id, { root: true })) |
| 220 | }) |
| 221 | |
| 222 | await Promise.all(fetchPromises) |
| 223 | }, |
| 224 | |
| 225 | // Administrated teachers' pages |
| 226 | async fetchDataAdministratedTeachers ({ state, dispatch, getters }, options = {}) { |
nothing calls this directly
no test coverage detected