mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-03 20:14:31 +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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user