changes to the Mahnungssystem
Release Inventarsystem / release-docker (push) Successful in 9m58s

This commit is contained in:
2026-09-09 20:36:08 +02:00
parent b05d238a60
commit 09efedad69
2 changed files with 70 additions and 26 deletions
+5 -2
View File
@@ -256,6 +256,7 @@ function submitEmailMahnung() {
const loanId = document.getElementById('modalLoanId').value;
const email = document.getElementById('modalEmail').value;
const message = document.getElementById('modalMessage').value;
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '';
if (!email) {
alert('Bitte geben Sie eine gültige E-Mail-Adresse ein.');
@@ -264,7 +265,7 @@ function submitEmailMahnung() {
fetch('/mahnungen_send_email', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken },
body: JSON.stringify({ loan_id: loanId, email: email, message: message })
})
.then(response => response.json())
@@ -289,9 +290,11 @@ function resetMahnung(loanId, studentName) {
return;
}
const csrfToken = document.querySelector('meta[name="csrf-token"]')?.content || '';
fetch('/mahnungen_reset', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
headers: { 'Content-Type': 'application/json', 'X-CSRFToken': csrfToken },
body: JSON.stringify({ loan_id: loanId })
})
.then(response => response.json())