checkpoint

This commit is contained in:
2026-10-28 14:22:27 +02:00
parent 33dad8ca5a
commit bd22fa86b7
11 changed files with 161 additions and 52 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
// Inbox: loads messages as JSON (GET /messages) and marks them read (POST /messages/{id}/read).
// Inbox: loads messages as JSON (GET /messages/list) and marks them read (POST /messages/{id}/read).
const inbox = document.querySelector('.inbox');
const list = inbox.querySelector('.inbox-list');
const status = inbox.querySelector('.inbox-status');
@@ -8,7 +8,7 @@ const dateFormat = new Intl.DateTimeFormat(document.documentElement.lang, { date
async function load() {
try {
const res = await fetch(`${t.api}?unreadOnly=${unreadOnly.checked}`, { headers: { Accept: 'application/json' } });
const res = await fetch(`${t.list}?unreadOnly=${unreadOnly.checked}`, { headers: { Accept: 'application/json' } });
if (!res.ok || res.redirected) throw new Error(res.status);
render(await res.json());
} catch {
@@ -65,7 +65,7 @@ function markReadButton(id, li) {
button.textContent = t.markRead;
button.addEventListener('click', async () => {
button.disabled = true;
const res = await fetch(`${t.api}/${id}/read`, {
const res = await fetch(`${t.base}/${id}/read`, {
method: 'POST',
headers: { RequestVerificationToken: t.token }
});