Merge pull request #7134 from firefly-iii/fix-7131

Fix #7131 by expanding the global ajaxSetup instructions.
This commit is contained in:
James Cole
2023-03-05 07:52:09 +01:00
committed by GitHub
2 changed files with 11 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ function stopSorting() {
//$.post('api/v1/accounts/' + id, {order: newOrder, _token: token});
$.ajax({
url: 'api/v1/accounts/' + id,
data: {order: newOrder},
data: JSON.stringify({order: newOrder}),
type: 'PUT',
});
});

View File

@@ -20,9 +20,18 @@
/** global: moment, token, dateRangeMeta,dateRangeConfig, accountingConfig, accounting, currencySymbol, mon_decimal_point, frac_digits, showFullList, showOnlyTop, mon_thousands_sep */
$.ajaxSetup({
headers: {
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content'),
'Content-Type': 'application/json'
}
});
$(function () {
"use strict";
configAccounting(currencySymbol);
// on submit of logout button:
@@ -37,11 +46,7 @@ $(function () {
$('button[type="submit"]').prop('disabled', true);
});
$.ajaxSetup({
headers: {
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
}
});
// when you click on a currency, this happens:
$('.currency-option').on('click', currencySelect);