Skip to content

Firefly III: a personal finances manager

Fix #7188

James Cole38624442d1d6
diff --git a/public/v1/js/ff/accounts/index.js b/public/v1/js/ff/accounts/index.js
index e03353a2de..35d9d2df29 100644
--- a/public/v1/js/ff/accounts/index.js
+++ b/public/v1/js/ff/accounts/index.js
@@ -87,10 +87,14 @@ function stopSorting() {
// post new position via API!
//$.post('api/v1/accounts/' + id, {order: newOrder, _token: token});
$.ajax({
- url: 'api/v1/accounts/' + id,
- data: JSON.stringify({order: newOrder}),
- type: 'PUT',
- });
+ url: 'api/v1/accounts/' + id,
+ data: JSON.stringify({order: newOrder}),
+ type: 'PUT',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content'),
+ },
+ });
});
}
diff --git a/public/v1/js/ff/accounts/show.js b/public/v1/js/ff/accounts/show.js
index 0ad69d3f61..9059b31398 100644
--- a/public/v1/js/ff/accounts/show.js
+++ b/public/v1/js/ff/accounts/show.js
@@ -120,7 +120,7 @@ function sortStop(event, ui) {
});
// do extra animation when done?
- $.post('transactions/reorder', {items: submit, date: thisDate, _token: token});
+ $.post('transactions/reorder', {items: submit, date: thisDate});
current.animate({backgroundColor: "#5cb85c"}, 200, function () {
$(this).animate({backgroundColor: originalBG}, 200);
diff --git a/public/v1/js/ff/firefly.js b/public/v1/js/ff/firefly.js
index fb7e6427d1..00a07b80ea 100644
--- a/public/v1/js/ff/firefly.js
+++ b/public/v1/js/ff/firefly.js
@@ -22,9 +22,7 @@
$.ajaxSetup({
headers: {
- 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content'),
- 'Content-Type': 'application/json'
-
+ 'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
}
});
@@ -79,8 +77,7 @@ $(function () {
data: {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
- label: label,
- _token: token
+ label: label
},
type: 'POST',
headers: {
diff --git a/public/v1/js/ff/help.js b/public/v1/js/ff/help.js
index e7bc07798e..36998bbfea 100644
--- a/public/v1/js/ff/help.js
+++ b/public/v1/js/ff/help.js
@@ -45,7 +45,7 @@ function showHelp(e) {
}
function enableGuidance(route, specialPage) {
- $.post('json/intro/enable/' + route + '/' + specialPage, {_token: token}).done(function (data) {
+ $.post('json/intro/enable/' + route + '/' + specialPage).done(function (data) {
alert(data.message);
}).fail(function () {
console.error('Could not re-enable introduction.');