Using lms.call across the Vue app

This commit is contained in:
scmmishra
2018-11-19 15:12:39 +05:30
committed by Aditya Hase
parent 0a4902f8b5
commit 80ecc56cbe
5 changed files with 68 additions and 70 deletions

View File

@@ -11,10 +11,10 @@ export default {
props: ['nextContent', 'nextContentType'],
name: 'ContentNavigation',
methods: {
goNext() {
addActivity() {
if(this.$route.params.type != "Quiz"){
frappe.call({
method: "erpnext.www.lms.add_activity",
lms.call({
method: "add_activity",
args: {
enrollment: lms.store.enrolledCourses[this.$route.params.course],
content_type: this.$route.params.type,
@@ -22,29 +22,14 @@ export default {
}
})
}
},
goNext() {
this.addActivity()
this.$router.push({ name: 'content', params: { course: this.$route.params.course, type:this.nextContentType, content:this.nextContent }})
},
finish() {
if(this.$route.params.type != "Quiz"){
frappe.call({
method: "erpnext.www.lms.add_activity",
args: {
enrollment: lms.store.enrolledCourses[this.$route.params.course],
content_type: this.$route.params.type,
content: this.$route.params.content
}
})
}
frappe.call({
method: "erpnext.www.lms.mark_course_complete",
args: {
enrollment: lms.store.enrolledCourses[this.$route.params.course]
}
})
// lms.store.addCompletedCourses(this.$route.params.course)
lms.store.updateCompletedCourses()
this.addActivity()
this.$router.push({ name: 'program', params: { program_name: this.$route.params.program_name}})
//
lms.trigger('course-completed', course_name);
}