Skip to content

Commit

Permalink
views/plan/LessonSummaryPage/ResourceListTable.vue:AutoSave
Browse files Browse the repository at this point in the history
- added an updateCurrentLesson also when the resources save succeeds to
ensure that the memory image refers to the changes resources in this
file (Remove lesson or reorder lesson)
  • Loading branch information
paulbusse committed Nov 9, 2020
1 parent deb8fb3 commit f3fe001
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,15 @@
this.showSnackbarNotification('resourceOrderSaved');
},
autoSave(id, resources) {
this.saveLessonResources({ lessonId: id, resources: resources }).catch(() => {
this.updateCurrentLesson(id).then(currentLesson => {
this.setWorkingResources(currentLesson.resources);
this.saveLessonResources({ lessonId: id, resources: resources })
.then(() => {
this.updateCurrentLesson(id);
})
.catch(() => {
this.updateCurrentLesson(id).then(currentLesson => {
this.setWorkingResources(currentLesson.resources);
});
});
});
},
},
$trs: {
Expand Down

0 comments on commit f3fe001

Please sign in to comment.