This commit is contained in:
James Cole 2017-12-20 20:07:57 +01:00
parent 62a4af8607
commit 36c8275f5e
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
8 changed files with 9 additions and 8 deletions

View File

@ -96,7 +96,7 @@ function sortStop(event, ui) {
}); });
// do extra animation when done? // do extra animation when done?
$.post('transactions/reorder', {items: submit, date: thisDate}); $.post('transactions/reorder', {items: submit, date: thisDate, _token: token});
current.animate({backgroundColor: "#5cb85c"}, 200, function () { current.animate({backgroundColor: "#5cb85c"}, 200, function () {
$(this).animate({backgroundColor: originalBG}, 200); $(this).animate({backgroundColor: originalBG}, 200);

View File

@ -120,7 +120,7 @@ function updateBudgetedAmounts(e) {
// send a post to Firefly to update the amount: // send a post to Firefly to update the amount:
var newUri = budgetAmountUri.replace("REPLACE", id); var newUri = budgetAmountUri.replace("REPLACE", id);
$.post(newUri, {amount: value, start: periodStart, end: periodEnd}).done(function (data) { $.post(newUri, {amount: value, start: periodStart, end: periodEnd, _token: token}).done(function (data) {
// difference between new value and original value // difference between new value and original value
var difference = value - original; var difference = value - original;

View File

@ -95,6 +95,7 @@ function showError(text) {
function callExport() { function callExport() {
"use strict"; "use strict";
var data = $('#export').serialize(); var data = $('#export').serialize();
data['_token'] = token;
// call status, keep calling it until response is "finished"? // call status, keep calling it until response is "finished"?
intervalId = window.setInterval(checkStatus, 500); intervalId = window.setInterval(checkStatus, 500);

View File

@ -50,7 +50,7 @@ function showHelp(e) {
} }
function enableGuidance(route, specialPage) { function enableGuidance(route, specialPage) {
$.post('json/intro/enable/' + route + '/' + specialPage).done(function (data) { $.post('json/intro/enable/' + route + '/' + specialPage, {_token: token}).done(function (data) {
alert(data.message); alert(data.message);
}).fail(function () { }).fail(function () {
alert('Could not re-enable introduction.'); alert('Could not re-enable introduction.');

View File

@ -89,7 +89,7 @@ function stopSorting() {
var id = holder.data('id'); var id = holder.data('id');
order.push(id); order.push(id);
}); });
$.post('piggy-banks/sort', {order: order}).done(function () { $.post('piggy-banks/sort', {order: order, _token: token}).done(function () {
$('.loadSpin').removeClass('fa fa-refresh fa-spin'); $('.loadSpin').removeClass('fa fa-refresh fa-spin');
}); });
} }

View File

@ -115,11 +115,11 @@ function sortStop(event, ui) {
}); });
if (parent.hasClass('rule-triggers')) { if (parent.hasClass('rule-triggers')) {
$.post('rules/trigger/order/' + ruleId, {triggers: entries}).fail(function () { $.post('rules/trigger/order/' + ruleId, {triggers: entries, _token: token}).fail(function () {
alert('Could not re-order rule triggers. Please refresh the page.'); alert('Could not re-order rule triggers. Please refresh the page.');
}); });
} else { } else {
$.post('rules/action/order/' + ruleId, {actions: entries}).fail(function () { $.post('rules/action/order/' + ruleId, {actions: entries, _token: token}).fail(function () {
alert('Could not re-order rule actions. Please refresh the page.'); alert('Could not re-order rule actions. Please refresh the page.');
}); });

View File

@ -29,7 +29,7 @@ $(function () {
}); });
function startSearch(query) { function startSearch(query) {
$.post(searchUri, {query: query}).done(presentSearchResults).fail(searchFailure); $.post(searchUri, {query: query, _token: token}).done(presentSearchResults).fail(searchFailure);
} }
function searchFailure() { function searchFailure() {

View File

@ -71,7 +71,7 @@ function goToReconcile() {
baseHref = bases[0].href; baseHref = bases[0].href;
} }
$.post(baseHref + 'transactions/reconcile', {transactions: ids}).done(function () { $.post(baseHref + 'transactions/reconcile', {transactions: ids, _token: token}).done(function () {
window.location.reload(true); window.location.reload(true);
}).fail(function () { }).fail(function () {
alert('Could not reconcile transactions: please check the logs and try again later.'); alert('Could not reconcile transactions: please check the logs and try again later.');