feat: Add synchronous creation of single FAQ entry and duplicate question detection, update API documentation and frontend handling

This commit is contained in:
wizardchen
2025-12-02 21:14:24 +08:00
parent 845d990a48
commit f26cbe02e1
11 changed files with 447 additions and 11 deletions
@@ -1087,6 +1087,7 @@ import { useRouter } from 'vue-router'
import {
listFAQEntries,
upsertFAQEntries,
createFAQEntry,
updateFAQEntry,
updateFAQEntryStatusBatch,
deleteFAQEntries,
@@ -1908,10 +1909,7 @@ const handleSubmitEntry = async () => {
tag_id: editorForm.tag_id || '',
}
if (editorMode.value === 'create') {
await upsertFAQEntries(props.kbId, {
entries: [payload],
mode: 'append',
})
await createFAQEntry(props.kbId, payload)
MessagePlugin.success(t('knowledgeEditor.messages.createSuccess'))
} else if (currentEntryId.value) {
await updateFAQEntry(props.kbId, currentEntryId.value, payload)