easyappointments/assets/js/http/booking_settings_http_client.js

40 lines
1.1 KiB
JavaScript
Raw Normal View History

/* ----------------------------------------------------------------------------
2022-01-18 15:05:42 +03:00
* Easy!Appointments - Online Appointment 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
* ---------------------------------------------------------------------------- */
/**
* Booking Settings HTTP client.
*
* This module implements the booking settings related HTTP requests.
*/
App.Http.BookingSettings = (function () {
/**
* Save booking settings.
*
* @param {Object} bookingSettings
*
* @return {Object}
*/
function save(bookingSettings) {
const url = App.Utils.Url.siteUrl('booking_settings/save');
const data = {
csrf_token: vars('csrf_token'),
booking_settings: bookingSettings,
};
return $.post(url, data);
}
return {
save,
};
})();