Commit af4a819c authored by nick zheng's avatar nick zheng

chore: 调整问答知识库分片open执行时机

parent 22e03906
......@@ -294,18 +294,23 @@ async function handleDeleteQAKnowledgeChunk(chunkRelationId: string) {
// 更新知识库是否开启
function handleUpdateQAKnowledgeChunkOpen(chunkRelationId: string, chunkContentItem: QAKnowledgeChunkContentItem) {
chunkContentItem.isOpen = chunkContentItem.isOpen === 'Y' ? 'N' : 'Y'
chunkContentItem.isOpenLoading = true
const { isOpen } = chunkContentItem
const payload = {
kdId: props.kdId,
chunkRelationId,
isOpen: chunkContentItem.isOpen,
isOpen: (isOpen === 'Y' ? 'N' : 'Y') as 'Y' | 'N',
}
fetchOpenQAKnowledgeChunk(payload)
.then((res) => {
if (res.code === 0) {
chunkContentItem.isOpen = isOpen === 'Y' ? 'N' : 'Y'
}
})
.catch(() => {
chunkContentItem.isOpen = chunkContentItem.isOpen === 'Y' ? 'N' : 'Y'
chunkContentItem.isOpen = isOpen === 'Y' ? 'N' : 'Y'
})
.finally(() => {
chunkContentItem.isOpenLoading = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment