This commit is contained in:
scmmishra 2018-11-23 17:16:33 +05:30 committed by Aditya Hase
parent 082e3c94ef
commit 9229f4fc92
2 changed files with 8 additions and 6 deletions

View File

@ -45,7 +45,7 @@ export default {
program_name: this.program.name, program_name: this.program.name,
}).then(data => { }).then(data => {
console.log(data) console.log(data)
lms.store.enrolledPrograms.add(data), lms.store.updateEnrolledPrograms()
this.$router.push(this.programRoute) this.$router.push(this.programRoute)
}) })
} }

View File

@ -23,17 +23,19 @@ frappe.ready(() => {
updateEnrolledPrograms() { updateEnrolledPrograms() {
if(this.isLogin) { if(this.isLogin) {
lms.call("get_program_enrollments").then(data => { lms.call("get_program_enrollments").then(data => {
if(data) this.enrolledPrograms = data this.enrolledPrograms = data
}); });
if (lms.debug) console.log('Updated Enrolled Programs', this.enrolledPrograms) if (lms.debug) console.log('Updated Enrolled Programs', this.enrolledPrograms)
} }
}, },
updateEnrolledCourses() { updateEnrolledCourses() {
lms.call("get_all_course_enrollments").then(data => { if(this.isLogin) {
if(data) this.enrolledCourses = data lms.call("get_all_course_enrollments").then(data => {
}) this.enrolledCourses = data
if (lms.debug) console.log('Updated Enrolled Courses', this.enrolledCourses) })
if (lms.debug) console.log('Updated Enrolled Courses', this.enrolledCourses)
}
}, },
checkLogin() { checkLogin() {