This commit is contained in:
Team3
2026-06-06 02:26:42 +02:00
parent a8fbf83059
commit 18bb18bf4a
30 changed files with 1184 additions and 4880 deletions

View File

@@ -14,6 +14,29 @@ export async function createGuide(topic, format, instructions = '', provider = '
return res.json()
}
export async function fetchActiveBausteine() {
const res = await fetch(`${BASE}/bausteine/active`)
return res.json()
}
export async function fetchBausteineStatus(topic) {
const res = await fetch(`${BASE}/bausteine/status?topic=${encodeURIComponent(topic)}`)
return res.json()
}
export async function createBausteine(topic, instructions = '', provider = 'claude') {
const res = await fetch(`${BASE}/bausteine`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ topic, instructions, provider }),
})
return res.json()
}
export async function deleteBausteine(topic) {
await fetch(`${BASE}/bausteine?topic=${encodeURIComponent(topic)}`, { method: 'DELETE' })
}
export async function fetchProviders() {
const res = await fetch(`${BASE}/providers`)
return res.json()
@@ -36,8 +59,15 @@ export async function deleteGuide(id) {
await fetch(`${BASE}/guides/${id}`, { method: 'DELETE' })
}
export function htmlUrl(id) {
return `${BASE}/guides/${id}/html`
export async function fetchGuideContent(id) {
const res = await fetch(`${BASE}/guides/${id}/content`)
if (!res.ok) throw new Error(`Inhalt nicht verfügbar (${res.status})`)
return res.json()
}
export async function fetchTopics() {
const res = await fetch(`${BASE}/topics`)
return res.json()
}
export async function fetchProgress(id) {