Use X-HTTP-Method-Override for all MfH pages

remotes/remote_mirror_8/master
Mike Koch 7 лет назад
Родитель 3aea482c3c
Коммит 454013fd98

@ -96,6 +96,24 @@ function generateToken(userId) {
});
}
function markSuccess(id) {
$('#' + id + '-saving').addClass('hide');
$('#' + id + '-failure').addClass('hide');
$('#' + id + '-success').removeClass('hide');
}
function markSaving(id) {
$('#' + id + '-saving').removeClass('hide');
$('#' + id + '-failure').addClass('hide');
$('#' + id + '-success').addClass('hide');
}
function markFailure(id) {
$('#' + id + '-saving').addClass('hide');
$('#' + id + '-failure').removeClass('hide');
$('#' + id + '-success').addClass('hide');
}
function clearTokens(userId) {
var heskPath = $('p#hesk-path').text();
var endpoint = heskPath + 'internal-api/admin/api-authentication/';

@ -94,9 +94,12 @@ $(document).ready(function() {
$modal.find('#action-buttons').find('.save-button').attr('disabled', 'disabled');
$.ajax({
method: method,
method: 'POST',
url: url,
headers: { 'X-Internal-Call': true },
headers: {
'X-Internal-Call': true,
'X-HTTP-Method-Override': method
},
data: JSON.stringify(data),
success: function(data) {
if (id === -1) {
@ -310,9 +313,12 @@ function bindDeleteButton() {
var element = elements[$(this).parent().parent().find('[data-property="id"]').text()];
$.ajax({
method: 'DELETE',
method: 'POST',
url: heskUrl + 'api/index.php/v1-internal/custom-navigation/' + element.id,
headers: { 'X-Internal-Call': true },
headers: {
'X-Internal-Call': true,
'X-HTTP-Method-Override': 'DELETE'
},
success: function() {
mfhAlert.success(mfhLang.text('custom_nav_element_deleted'));
loadTable();

Загрузка…
Отмена
Сохранить