Orphan-Junction-Cleanup + Refresh-Button für Fragen/Wörter
- Backend: DELETE question/word räumt alle Junction-Zeilen mit auf - Backend: /purge-orphans bereinigt verwaiste Junctions per Objekt - Frontend: reloadQW ruft purgeOrphans vor dem Neu-Laden auf - Frontend: ↺-Button in Wörter- und Fragen-Sidebar Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -281,3 +281,13 @@ export async function deleteWord(wId: string, token: string): Promise<void> {
|
||||
})
|
||||
if (!res.ok) throw new Error('Fehler beim Löschen des Worts')
|
||||
}
|
||||
|
||||
export async function purgeOrphans(objId: string, token: string): Promise<{ orphans_removed: number }> {
|
||||
const res = await fetch(`/api/object/${encodeURIComponent(objId)}/purge-orphans`, {
|
||||
method: 'POST',
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
})
|
||||
const data = await res.json()
|
||||
if (!res.ok) throw new Error('Fehler beim Bereinigen')
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user