DocWeave / frontend /src /api /knowledge.js
shak3008's picture
feat: complete end-to-end platform with all standout behaviors
fcacf10
Raw
History Blame Contribute Delete
641 Bytes
import { apiRequest } from "./client";
export async function listKnowledge(workspaceId, { status, type } = {}) {
let url = `/knowledge?workspace_id=${encodeURIComponent(workspaceId)}`;
if (status) url += `&status=${encodeURIComponent(status)}`;
if (type) url += `&type=${encodeURIComponent(type)}`;
return apiRequest(url);
}
export async function searchKnowledge(workspaceId, query) {
return apiRequest(
`/knowledge/search?workspace_id=${encodeURIComponent(workspaceId)}&q=${encodeURIComponent(query)}`
);
}
export async function getKnowledgeItem(itemId) {
return apiRequest(`/knowledge/${itemId}`);
}