This commit is contained in:
team3
2026-05-25 22:59:37 +02:00
parent e964c807d9
commit 619bac34cb
8 changed files with 339 additions and 88 deletions

View File

@@ -10,11 +10,20 @@ export async function fetchGuide(id) {
return res.json()
}
export async function createGuide(topic, format) {
export async function createGuide(topic, format, instructions = '') {
const res = await fetch(`${BASE}/guides`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ topic, format }),
body: JSON.stringify({ topic, format, instructions }),
})
return res.json()
}
export async function reworkGuide(id, instructions) {
const res = await fetch(`${BASE}/guides/${id}/rework`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ instructions }),
})
return res.json()
}