Fix: eagerload series.sets i admin og API (MissingGreenlet i async mode)

This commit is contained in:
2026-07-01 22:15:14 +02:00
parent c0952a3bd3
commit 8361066f2f
20 changed files with 1075 additions and 554 deletions
+6 -7
View File
@@ -24,21 +24,20 @@
document.getElementById('login-form').addEventListener('submit', async (e) => {
e.preventDefault();
const form = e.target;
const data = { username: form.username.value, password: form.password.value };
const formData = { username: form.username.value, password: form.password.value };
const errEl = document.getElementById('login-error');
try {
const res = await fetch('/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data),
redirect: 'manual',
body: JSON.stringify(formData),
});
if (res.ok) {
window.location.href = '/';
const json = await res.json();
if (json.ok) {
window.location.href = json.redirect || '/';
} else {
const err = await res.json();
errEl.textContent = err.detail || 'Login fejlede';
errEl.textContent = json.detail || 'Login fejlede';
errEl.style.display = 'block';
}
} catch(e) {