This commit is contained in:
2023-08-12 13:14:26 +03:00
parent 7c7452a93d
commit 1d64583697
3 changed files with 38 additions and 29 deletions

View File

@@ -225,29 +225,30 @@ function sendMessage(id_ticket=null,sender,receiver){
$.ajax({
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
url: '/ru/messages/send_msg/',
type: "POST",
// async: true,
cache: false,
processData: false,
contentType: false,
// enctype: 'json',
data: JSON.stringify(data),
success: function(data){
getNewMessageSession()
document.querySelector(".container-messages").innerHTML = data.html;
document.querySelector(".enter-message-inp").focus()
},
error: function (data){
document.querySelector(".container-messages").innerHTML = data.responseJSON.error;
document.querySelector(".enter-message-inp").focus()
}
});
// $.ajax({
// headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
// url: '/ru/messages/send_msg/',
// type: "POST",
// // async: true,
// cache: false,
// processData: false,
// contentType: false,
// // enctype: 'json',
// data: JSON.stringify(data),
// success: function(data){
// getNewMessageSession()
//
// document.querySelector(".container-messages").innerHTML = data.html;
// document.querySelector(".enter-message-inp").focus()
//
// },
// error: function (data){
//
// document.querySelector(".container-messages").innerHTML = data.responseJSON.error;
// document.querySelector(".enter-message-inp").focus()
// }
// });
sendMessageSocket(data)
}
}