fix: Content fetching for articles and videos
diff --git a/erpnext/public/js/education/lms/components/Article.vue b/erpnext/public/js/education/lms/components/Article.vue
index 202947e..4678db2 100644
--- a/erpnext/public/js/education/lms/components/Article.vue
+++ b/erpnext/public/js/education/lms/components/Article.vue
@@ -31,7 +31,10 @@
},
methods: {
getContent() {
- return frappe.db.get_doc(this.type, this.content)
+ return lms.call('get_content', {
+ type: this.type,
+ content: this.content
+ })
}
},
components: {
diff --git a/erpnext/public/js/education/lms/components/Video.vue b/erpnext/public/js/education/lms/components/Video.vue
index c86bf1a..3cfca05 100644
--- a/erpnext/public/js/education/lms/components/Video.vue
+++ b/erpnext/public/js/education/lms/components/Video.vue
@@ -50,7 +50,10 @@
},
methods: {
getContent() {
- return frappe.db.get_doc(this.type, this.content)
+ return lms.call('get_content', {
+ type: this.type,
+ content: this.content
+ })
}
}
};
diff --git a/erpnext/www/lms.py b/erpnext/www/lms.py
index c2a8bd5..b91dcc9 100644
--- a/erpnext/www/lms.py
+++ b/erpnext/www/lms.py
@@ -280,4 +280,11 @@
def get_topics(course_name):
course = frappe.get_doc('Course', course_name)
topics = course.get_topics()
- return topics
\ No newline at end of file
+ return topics
+
+@frappe.whitelist()
+def get_content(type, content):
+ try:
+ return frappe.get_doc(type, content)
+ except:
+ return None
\ No newline at end of file