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:
parent
4427a936b4
commit
c161bb013e
11 changed files with 79 additions and 35 deletions
|
@ -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 = ['${', '}'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue