File: /var/www/vhost/disk-apps/agile-selling-mia/public/js/configuration.js
function chkOrderType(id){
$(".alert-text").css('display','none');
var state;
if ($('#chkOrderType'+id).is(':checked')) {
state = 1;
} else {
state = 0;
}
var info = {
"id": id,
"state": state
};
$.ajax({
url: "/configuration/typeOrder",
type: "PUT",
contentType: 'application/json',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
'Content-Type': 'application/json'
},
data: JSON.stringify(info),
success: function (r) {
if (r.r) {
$(".alert-text").css('display','flex');
// setTimeout( function(){
// $(".alert-text").css('display','none');
// },4000);
} else {
swal("Ok", "¡Error al modificar tipo de pedido", "error");
}
},
error: function (e) {
swal("Ok", "¡Error al modificar tipo de pedido", "error");
}
});
}