udpate
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user