(state, courses)
| 33 | mutations: { |
| 34 | // TODO this doesn't handle removed courses (unlikely to occur - but would this be simpler if we built an object by id from response and swapped it out |
| 35 | addCourses (state, courses) { |
| 36 | courses.forEach(c => Vue.set(state.byId, c._id, c)) |
| 37 | state.loaded = true |
| 38 | }, |
| 39 | addOtherCourses (state, courses) { |
| 40 | courses.forEach(c => Vue.set(state.otherById, c._id, c)) |
| 41 | state.loadedOther = true |