jichoi / lms_front star
구자현 구자현 08-20
240820 구자현 대시보드 학습 종료 로직 수정
@1b54806d9ad5f396d795a747ef4d246300e2ef9e
client/views/pages/main/Dashboard.vue
--- client/views/pages/main/Dashboard.vue
+++ client/views/pages/main/Dashboard.vue
@@ -432,20 +432,23 @@
                     finish: "T"
                 }
             })
-                .then(response => {
-                    const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id);
-                    alert("학습을 완료했습니다!");
-                    window.location.reload();
-                    if (nextSchedule) {
-                        this.nowSchedule = nextSchedule;
-                        this.$router.push({ name: 'Dashboard' });
-                    } else {
-                        alert("모든 학습을 완료했습니다!");
+            .then(response => {
+                const nextSchedule = this.schedules.find(schedule => schedule.schdl_id > this.nowSchedule.schdl_id);
+                alert("학습을 완료했습니다!");
+
+                if (nextSchedule) {
+                    this.nowSchedule = nextSchedule;
+                    this.fetchSchedule(nextSchedule.unit_id, nextSchedule.book_id);
+                    this.fetchRoadmapData(nextSchedule.unit_id, nextSchedule.book_id);
+                    this.$router.push({ name: 'Dashboard', query: { unit_id: nextSchedule.unit_id, book_id: nextSchedule.book_id } });
+                } else {
+                    alert("모든 학습을 완료했습니다!");
+                    this.state = 'finish';
                     }
                 })
-                .catch(error => {
-                    console.error("Error updating schedule:", error);
-                });
+            .catch(error => {
+                 console.error("Error updating schedule:", error);
+            });
         },
         fetchRoadmapData(unit_id, book_id) {
             axios({
Add a comment
List