mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-12 01:42:32 +00:00
Convert GET routes to POST.
This commit is contained in:
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