This commit is contained in:
team3
2026-06-12 17:46:30 +02:00
parent 0ba708dc54
commit a7fd345bb6
8 changed files with 136 additions and 77 deletions

View File

@@ -66,18 +66,18 @@ export async function fetchBausteinLernstand(topic) {
return jsonOrThrow(res)
}
export async function fetchVertiefung(topic, baustein) {
export async function fetchVertiefung(topic, baustein, art = 'vertiefung') {
const res = await fetch(
`${BASE}/bausteine/vertiefung?topic=${encodeURIComponent(topic)}&baustein=${encodeURIComponent(baustein)}`
`${BASE}/bausteine/vertiefung?topic=${encodeURIComponent(topic)}&baustein=${encodeURIComponent(baustein)}&art=${art}`
)
return jsonOrThrow(res)
}
export async function createVertiefung({ topic, baustein, section, provider }) {
export async function createVertiefung({ topic, baustein, section, art = 'vertiefung', provider }) {
const res = await fetch(`${BASE}/bausteine/vertiefung`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ topic, baustein, section, provider }),
body: JSON.stringify({ topic, baustein, section, art, provider }),
})
return jsonOrThrow(res)
}