easyappointments/assets/js/http/services_http_client.min.js

1 line
1.1 KiB
JavaScript
Executable File

"use strict";App.Http.Services=function(){function store(service){var url=App.Utils.Url.siteUrl("services/store"),data={csrf_token:vars("csrf_token"),service:service};return $.post(url,data)}function update(service){var url=App.Utils.Url.siteUrl("services/update"),data={csrf_token:vars("csrf_token"),service:service};return $.post(url,data)}return{save:function(service){return service.id?update(service):store(service)},store:store,update:update,destroy:function(serviceId){var url=App.Utils.Url.siteUrl("services/destroy"),data={csrf_token:vars("csrf_token"),service_id:serviceId};return $.post(url,data)},search:function(keyword){var limit=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null,offset=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null,orderBy=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null,url=App.Utils.Url.siteUrl("services/search"),data={csrf_token:vars("csrf_token"),keyword:keyword,limit:limit,offset:offset,order_by:orderBy};return $.post(url,data)},find:function(serviceId){var url=App.Utils.Url.siteUrl("services/find"),data={csrf_token:vars("csrf_token"),service_id:serviceId};return $.post(url,data)}}}();