mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
feat: add check for toggling the route
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
|
||||
frappe.ready(() => {
|
||||
initialise_select_date()
|
||||
frappe.ready(async () => {
|
||||
debugger
|
||||
let isSchedulingEnabled = await frappe.call({
|
||||
method:'erpnext.www.book-appointment.index.is_enabled'
|
||||
})
|
||||
isSchedulingEnabled = isSchedulingEnabled.message
|
||||
if (!isSchedulingEnabled) {
|
||||
frappe.show_alert("This feature is not enabled");
|
||||
window.location.replace('/');
|
||||
return;
|
||||
}
|
||||
initialise_select_date();
|
||||
})
|
||||
|
||||
window.holiday_list = [];
|
||||
|
||||
async function initialise_select_date() {
|
||||
@@ -16,7 +26,7 @@ async function get_global_variables() {
|
||||
// Using await
|
||||
window.appointment_settings = (await frappe.call({
|
||||
method: 'erpnext.www.book-appointment.index.get_appointment_settings'
|
||||
})).message
|
||||
})).message;
|
||||
window.timezones = (await frappe.call({
|
||||
method: 'erpnext.www.book-appointment.index.get_timezones'
|
||||
})).message;
|
||||
|
||||
@@ -15,6 +15,11 @@ def get_appointment_settings():
|
||||
settings = frappe.get_doc('Appointment Booking Settings')
|
||||
return settings
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def is_enabled():
|
||||
enable_scheduling = frappe.db.get_single_value('Appointment Booking Settings','enable_scheduling')
|
||||
return enable_scheduling
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_holiday_list(holiday_list_name):
|
||||
|
||||
Reference in New Issue
Block a user