mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-14 12:02:56 +03:00
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
|
/* ----------------------------------------------------------------------------
|
||
|
* Easy!Appointments - Open Source Web Scheduler
|
||
|
*
|
||
|
* @package EasyAppointments
|
||
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||
|
* @copyright Copyright (c) Alex Tselegidis
|
||
|
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
||
|
* @link https://easyappointments.org
|
||
|
* @since v1.5.0
|
||
|
* ---------------------------------------------------------------------------- */
|
||
|
|
||
|
App.Http.BusinessSettings = (function () {
|
||
|
/**
|
||
|
* Save business settings.
|
||
|
*
|
||
|
* @param {Object} businessSettings
|
||
|
*
|
||
|
* @return {Object}
|
||
|
*/
|
||
|
function save(businessSettings) {
|
||
|
const url = App.Utils.Url.siteUrl('business_settings/save');
|
||
|
|
||
|
const data = {
|
||
|
csrf_token: App.Vars.csrf_token,
|
||
|
business_settings: businessSettings
|
||
|
};
|
||
|
|
||
|
return $.post(url, data);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Apply global working plan.
|
||
|
*
|
||
|
* @param {Object} workingPlan
|
||
|
*
|
||
|
* @return {Object}
|
||
|
*/
|
||
|
function applyGlobalWorkingPlan(workingPlan) {
|
||
|
const url = App.Utils.Url.siteUrl('business_settings/apply_global_working_plan');
|
||
|
|
||
|
const data = {
|
||
|
csrf_token: App.Vars.csrf_token,
|
||
|
working_plan: JSON.stringify(workingPlan)
|
||
|
};
|
||
|
|
||
|
return $.post(url, data);
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
save,
|
||
|
applyGlobalWorkingPlan
|
||
|
};
|
||
|
})();
|