Glossar: Eintraege bearbeitbar (PUT /api/glossary/:id + GUI-Editier-Flow)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113vDKdSNtD3Dwcw4QMu9yV
This commit is contained in:
schakal00783
2026-07-16 23:55:27 +02:00
co-authored by Claude Fable 5
parent fdae4ce119
commit 1016eaa095
4 changed files with 43 additions and 6 deletions
+8
View File
@@ -254,6 +254,14 @@ app.post('/api/glossary', wrap(async (req, res) => {
res.json(await db.addGlossary(term, soundalikes));
}));
app.delete('/api/glossary/:id', wrap(async (req, res) => { await db.deleteGlossary(+req.params.id); res.json({ ok: true }); }));
app.put('/api/glossary/:id', wrap(async (req, res) => {
const term = (req.body && req.body.term || '').trim();
const soundalikes = (req.body && req.body.soundalikes || '').trim();
if (!term) return res.status(400).json({ error: 'Begriff fehlt' });
const g = await db.updateGlossary(+req.params.id, term, soundalikes);
if (!g) return res.status(404).json({ error: 'Eintrag nicht gefunden' });
res.json(g);
}));
// --- LLM ---
app.get('/api/llm/status', (req, res) => res.json(llm.status()));