mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 11:08:28 +00:00
Convert GET routes to POST.
This commit is contained in:
35
public/v1/js/ff/currencies/index.js
vendored
35
public/v1/js/ff/currencies/index.js
vendored
@@ -25,6 +25,8 @@ $(function () {
|
||||
"use strict";
|
||||
$('.make_default').on('click', setDefaultCurrency);
|
||||
|
||||
$('.enable-currency').on('click', enableCurrency);
|
||||
$('.disable-currency').on('click', disableCurrency);
|
||||
});
|
||||
|
||||
function setDefaultCurrency(e) {
|
||||
@@ -40,4 +42,37 @@ function setDefaultCurrency(e) {
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function enableCurrency(e) {
|
||||
var button = $(e.currentTarget);
|
||||
var currencyId = parseInt(button.data('id'));
|
||||
|
||||
$.post(enableCurrencyUrl, {
|
||||
_token: token,
|
||||
id: currencyId
|
||||
}).done(function (data) {
|
||||
// lame but it works
|
||||
location.reload();
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function disableCurrency(e) {
|
||||
var button = $(e.currentTarget);
|
||||
var currencyId = parseInt(button.data('id'));
|
||||
|
||||
$.post(disableCurrencyUrl, {
|
||||
_token: token,
|
||||
id: currencyId
|
||||
}).done(function (data) {
|
||||
// lame but it works
|
||||
location.reload();
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
18
public/v1/js/ff/list/groups.js
vendored
18
public/v1/js/ff/list/groups.js
vendored
@@ -23,6 +23,7 @@ var count = 0;
|
||||
$(document).ready(function () {
|
||||
updateListButtons();
|
||||
addSort();
|
||||
$('.clone-transaction').click(cloneTransaction);
|
||||
});
|
||||
|
||||
var fixHelper = function (e, tr) {
|
||||
@@ -206,4 +207,19 @@ function updateActionButtons() {
|
||||
if (0 === count) {
|
||||
$('.action-menu').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
function cloneTransaction(e) {
|
||||
var button = $(e.currentTarget);
|
||||
var groupId = parseInt(button.data('id'));
|
||||
|
||||
$.post(cloneGroupUrl, {
|
||||
_token: token,
|
||||
id: groupId
|
||||
}).done(function (data) {
|
||||
// lame but it works
|
||||
location.href = data.redirect;
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
17
public/v1/js/ff/transactions/show.js
vendored
17
public/v1/js/ff/transactions/show.js
vendored
@@ -23,6 +23,7 @@
|
||||
$(function () {
|
||||
"use strict";
|
||||
$('.link-modal').click(getLinkModal);
|
||||
$('.clone-transaction').click(cloneTransaction);
|
||||
$('#linkJournalModal').on('shown.bs.modal', function () {
|
||||
makeAutoComplete();
|
||||
})
|
||||
@@ -80,3 +81,19 @@ function selectedJournal(event, journal) {
|
||||
$('#selected-journal').html('<a href="' + groupURI.replace('%GROUP%', journal.transaction_group_id) + '">' + journal.description + '</a>').show();
|
||||
$('input[name="opposing"]').val(journal.id);
|
||||
}
|
||||
|
||||
function cloneTransaction(e) {
|
||||
var button = $(e.currentTarget);
|
||||
var groupId = parseInt(button.data('id'));
|
||||
|
||||
$.post(cloneGroupUrl, {
|
||||
_token: token,
|
||||
id: groupId
|
||||
}).done(function (data) {
|
||||
// lame but it works
|
||||
location.href = data.redirect;
|
||||
}).fail(function () {
|
||||
console.error('I failed :(');
|
||||
});
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user