feat: implement batch move and delete functionality for documents and FAQs
This commit is contained in:
@@ -1532,6 +1532,12 @@ export type UpdateKnowledgeFAQPayload = CreateKnowledgeFAQPayload & {
|
||||
id: number
|
||||
}
|
||||
|
||||
export type BatchMoveKnowledgeContentPayload = {
|
||||
knowledgeBaseId: number
|
||||
directoryId: number
|
||||
ids: number[]
|
||||
}
|
||||
|
||||
export type KnowledgeDirectory = {
|
||||
id: number
|
||||
knowledgeBaseId: number
|
||||
@@ -1690,6 +1696,20 @@ export function deleteKnowledgeDocument(id: number) {
|
||||
})
|
||||
}
|
||||
|
||||
export function batchMoveKnowledgeDocuments(payload: BatchMoveKnowledgeContentPayload) {
|
||||
return request<void>("/api/dashboard/knowledge-document/batch_move", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
export function batchDeleteKnowledgeDocuments(ids: number[]) {
|
||||
return request<void>("/api/dashboard/knowledge-document/batch_delete", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ ids }),
|
||||
})
|
||||
}
|
||||
|
||||
export function buildKnowledgeDocumentIndex(documentId: number) {
|
||||
return request<void>("/api/dashboard/knowledge-retrieve/build", {
|
||||
method: "POST",
|
||||
@@ -1730,6 +1750,20 @@ export function deleteKnowledgeFAQ(id: number) {
|
||||
})
|
||||
}
|
||||
|
||||
export function batchMoveKnowledgeFAQs(payload: BatchMoveKnowledgeContentPayload) {
|
||||
return request<void>("/api/dashboard/knowledge-faq/batch_move", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
export function batchDeleteKnowledgeFAQs(ids: number[]) {
|
||||
return request<void>("/api/dashboard/knowledge-faq/batch_delete", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ ids }),
|
||||
})
|
||||
}
|
||||
|
||||
function downloadBlob(blob: Blob, filename: string) {
|
||||
const url = URL.createObjectURL(blob)
|
||||
const link = document.createElement("a")
|
||||
|
||||
Reference in New Issue
Block a user