diff --git a/static/js/user_profile_2.js b/static/js/user_profile_2.js index ebc6a91..2891314 100644 --- a/static/js/user_profile_2.js +++ b/static/js/user_profile_2.js @@ -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 () { diff --git a/templates/blocks/profile/b_subscribe_current.html b/templates/blocks/profile/b_subscribe_current.html index 5e2fbfc..ff95d7c 100644 --- a/templates/blocks/profile/b_subscribe_current.html +++ b/templates/blocks/profile/b_subscribe_current.html @@ -32,7 +32,13 @@