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:
co-authored by
Claude Fable 5
parent
fdae4ce119
commit
1016eaa095
@@ -52,6 +52,11 @@ export async function addGlossary(term, soundalikes) {
|
||||
export async function deleteGlossary(id) {
|
||||
await pool.execute('DELETE FROM glossary WHERE id=?', [id]);
|
||||
}
|
||||
export async function updateGlossary(id, term, soundalikes) {
|
||||
await pool.execute('UPDATE glossary SET term=?, soundalikes=? WHERE id=?', [term, soundalikes || null, id]);
|
||||
const [rows] = await pool.execute('SELECT id, term, soundalikes, enabled FROM glossary WHERE id=?', [id]);
|
||||
return rows[0] ? { ...rows[0], enabled: !!rows[0].enabled } : null;
|
||||
}
|
||||
|
||||
export async function addVoiceprint(name, vec) {
|
||||
const [res] = await pool.execute(
|
||||
|
||||
Reference in New Issue
Block a user