Files
enlight-lms/school/lms/web_form/lesson/lesson.js
2022-03-19 09:31:39 +05:30

17 lines
556 B
JavaScript

frappe.ready(function() {
frappe.web_form.after_save = () => {
frappe.call({
method: "school.lms.doctype.course_lesson.course_lesson.get_lesson_info",
args: {
"chapter": frappe.web_form.doc.chapter
},
callback: (data) => {
frappe.msgprint(__(`Lesson has been saved successfully. Go back to the chapter and add this lesson to the lessons table.`));
setTimeout(() => {
window.location.href = `/courses/${data.message}`;
}, 3000);
}
});
};
});