feat: course cards
This commit is contained in:
@@ -139,3 +139,13 @@ def add_mentor_to_subgroup(subgroup, email):
|
||||
|
||||
sg.add_mentor(email)
|
||||
return {"ok": True}
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_courses():
|
||||
"""Returns the list of courses."""
|
||||
return frappe.get_all(
|
||||
"LMS Course",
|
||||
fields=["name", "title", "short_introduction", "image"],
|
||||
filters={"published": True},
|
||||
)
|
||||
|
||||
@@ -178,6 +178,7 @@ def get_lesson_icon(content):
|
||||
return icon
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_tags(course):
|
||||
tags = frappe.db.get_value("LMS Course", course, "tags")
|
||||
return tags.split(",") if tags else []
|
||||
|
||||
Reference in New Issue
Block a user