mirror of https://github.com/zulip/zulip.git
Use POST with method=PATCH when sending a bot edit
(imported from commit e6ee1631f0b37e66da5979a5fa6e6860d7f4d0b3)
This commit is contained in:
parent
13b452ddf8
commit
196706cc64
|
@ -182,6 +182,9 @@ $(function () {
|
|||
var formData = new FormData();
|
||||
formData.append('full_name', full_name);
|
||||
formData.append('csrfmiddlewaretoken', csrf_token);
|
||||
// Send a PATCH as a POST in order to work around QtWebkit (Linux/Windows desktop app)
|
||||
// not supporting PATCH body.
|
||||
formData.append('method', 'PATCH');
|
||||
jQuery.each(file_input[0].files, function (i, file) {
|
||||
formData.append('file-'+i, file);
|
||||
});
|
||||
|
@ -189,7 +192,7 @@ $(function () {
|
|||
edit_button.hide();
|
||||
$.ajax({
|
||||
url: '/json/bots/' + encodeURIComponent(email),
|
||||
type: 'PATCH',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
cache: false,
|
||||
processData: false,
|
||||
|
|
Loading…
Reference in New Issue