web: make ActionButton's method configurable

This commit is contained in:
Jens Langhammer
2021-02-09 16:08:43 +01:00
parent 552f8c6a9a
commit fa30755241
3 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,9 @@ export class ActionButton extends SpinnerButton {
@property()
url = "";
@property()
method = "POST";
callAction(): void {
if (this.isRunning === true) {
return;
@ -19,7 +22,7 @@ export class ActionButton extends SpinnerButton {
headers: { "X-CSRFToken": csrftoken },
});
fetch(request, {
method: "POST",
method: this.method,
mode: "same-origin",
})
.then((r) => {