fix: better msg on web form save

This commit is contained in:
Jannat Patel
2022-03-19 09:31:39 +05:30
15 changed files with 341 additions and 279 deletions
+5 -2
View File
@@ -1,5 +1,8 @@
frappe.ready(function() {
frappe.web_form.after_save = () => {
window.location.href = `/courses/${frappe.web_form.doc.course}`;
frappe.web_form.after_save = () => {
frappe.msgprint(__("Chapter has been saved successfully. Go back to the course and add this chapter to the chapters table."))
setTimeout(() => {
window.location.href = `/courses/${frappe.web_form.doc.course}`;
}, 3000);
}
});
+4 -3
View File
@@ -1,15 +1,16 @@
frappe.ready(function() {
frappe.web_form.after_save = () => {
setTimeout(() => {
frappe.call({
method: "school.lms.doctype.course_lesson.course_lesson.get_lesson_info",
args: {
"chapter": frappe.web_form.doc.chapter
},
callback: (data) => {
window.location.href = `/courses/${data.message}`;
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);
}
});
});
};
});