fix: batch switch with query parameters

This commit is contained in:
pateljannat
2021-06-22 10:11:21 +05:30
parent eb435261fe
commit 3384f974e5
17 changed files with 83 additions and 114 deletions

View File

@@ -51,7 +51,8 @@ frappe.ready(() => {
frappe.call({
"method": "community.lms.doctype.lms_batch_membership.lms_batch_membership.create_membership",
"args": {
"batch": "{{ batch.name }}"
"batch": {{ batch.name }},
"course": {{ batch.course }}
},
"callback": (data) => {
if (data.message == "OK") {
@@ -66,20 +67,6 @@ frappe.ready(() => {
}
})
})
$("#batch-home").click((e) => {
frappe.call({
method: "community.lms.doctype.lms_batch_membership.lms_batch_membership.update_current_membership",
args: {
"batch": "{{ batch.name }}",
"course": "{{ batch.course}}",
"member": frappe.session.user
},
callback: (data) => {
window.location.href = "/courses/{{ batch.course }}/home"
}
})
})
})
</script>
{% endblock %}