1.1.21 add function for checking the status of the switch finish_subscribe_msg
This commit is contained in:
@@ -804,6 +804,30 @@ function send_subscribe (el, id, for_movers, subscribe){
|
||||
}
|
||||
}
|
||||
|
||||
function updSwitchState(el){
|
||||
let stateToSend = el.checked
|
||||
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
url: '/subscribes/receive_finish_subscribe_msg/',
|
||||
type: "POST",
|
||||
// async: true,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
// enctype: 'json',
|
||||
data: { receive_finish_subscribe_msg: stateToSend },
|
||||
success: function(response){
|
||||
alert(response)
|
||||
|
||||
},
|
||||
error: function (data, exception){
|
||||
console.error('Произошла ошибка при выполнении AJAX запроса:', exception);
|
||||
console.log(data.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var last_open_curtain = null
|
||||
|
||||
function open_curtain_w_btn_profile () {
|
||||
|
||||
Reference in New Issue
Block a user