Creation and editing of events

This commit is contained in:
2026-02-16 21:59:21 +01:00
parent 2b458eccd7
commit fcf41c5d13
61 changed files with 3002 additions and 380 deletions

View File

@@ -0,0 +1,41 @@
import {ref} from "vue";
export async function request(url, options = {}) {
const loading = ref(true)
const isFormData = options.body instanceof FormData
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content')
const data = ref(null)
const error = ref(null)
error.value = null
data.value = null
try {
const response = await fetch(url, {
method: options.method || "GET",
headers: {
'X-CSRF-TOKEN': csrfToken,
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
...(options.headers || {}),
},
body: isFormData
? options.body // ✅ FormData direkt
: options.body
? JSON.stringify(options.body)
: null,
})
if (!response.ok) throw new Error(`HTTP ${response.status}`)
const result = await response.json()
data.value = result
return result
} catch (err) {
error.value = err
console.error("AJAX Error:", err)
return null
} finally {
loading.value = false
}
}

View File

@@ -147,7 +147,7 @@ const props = defineProps({
<tr>
<td>Version 4.0.0</td>
<td>
mareike - Mdodernes Anmeldesystem und richti einfache Kostenerfassung
mareike - Mdodernes Anmeldesystem und richtig einfache Kostenerfassung
</td>
<td>
Impressum