All checks were successful
continuous-integration/drone/push Build is passing
26 lines
668 B
JavaScript
26 lines
668 B
JavaScript
import { api8001 } from './api.js'
|
|
|
|
export async function fetchCategories() {
|
|
const { data } = await api8001.get('/categories_promt')
|
|
return data ?? []
|
|
}
|
|
|
|
export async function fetchSources(category = 'all') {
|
|
const { data } = await api8001.get('/all_sources', {
|
|
params: { category },
|
|
})
|
|
return data.sources ?? []
|
|
}
|
|
|
|
export async function addSource(url, prompt) {
|
|
await api8001.post('/add_sources', { url, promt: prompt })
|
|
}
|
|
|
|
export async function deleteSource(url) {
|
|
await api8001.delete('/delete_sources', { params: { url } })
|
|
}
|
|
|
|
export async function startSourceParsing(url, prompt) {
|
|
await api8001.post('/parser_all', { url, promt: prompt })
|
|
}
|