Feat: Refactor assignment filter to modal

This commit is contained in:
Björn Fromme
2023-10-24 11:40:40 +02:00
parent 5e35af9665
commit cb06bcd636
9 changed files with 119 additions and 89 deletions
+2 -4
View File
@@ -3,7 +3,7 @@ import { useFetch } from '../mixins/use_fetch'
export default class extends Controller {
static targets = [ 'title', 'content', 'spinner', 'backbutton' ]
static targets = [ 'title', 'content', 'spinner' ]
static values = { loading: Boolean }
connect() {
@@ -41,9 +41,7 @@ export default class extends Controller {
this.loadingValue = true
const form = event.target
const formData = new FormData(form)
if (this.hasBackbuttonTarget && event.submitter === this.backbuttonTarget) {
formData.append(this.backbuttonTarget.name, this.backbuttonTarget.value)
}
formData.append(event.submitter.name, event.submitter.value)
fetch(form.action, this.getInitObject('post', formData))
.then(this.checkStatus)
.then(this.parseJSON)