Change action GETs to POST (#10462)

* Change action GETs to POST

* submite = submit + smite

* No more # href

* Fix test

* Match other tests

* Explicit csrf

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
John Olheiser 2020-02-25 14:28:47 -06:00 committed by GitHub
parent 4427a936b4
commit c161bb013e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 79 additions and 35 deletions

View file

@ -2469,6 +2469,7 @@ $(document).ready(async () => {
// Helpers.
$('.delete-button').click(showDeletePopup);
$('.add-all-button').click(showAddAllPopup);
$('.link-action').click(linkAction);
$('.delete-branch-button').click(showDeletePopup);
@ -2735,6 +2736,19 @@ function showAddAllPopup() {
return false;
}
function linkAction() {
const $this = $(this);
$.post($this.data('url'), {
_csrf: csrf
}).done((data) => {
if (data.redirect) {
window.location.href = data.redirect;
} else {
window.location.reload();
}
});
}
function initVueComponents() {
const vueDelimeters = ['${', '}'];