From e9e9041381c3cdaf9f8de052af723b1cfbc92803 Mon Sep 17 00:00:00 2001 From: Coen Warmer Date: Wed, 13 Dec 2023 13:24:09 +0100 Subject: [PATCH] Fix incorrectly passed doc_id param (#173180) --- .../public/hooks/use_create_knowledge_base_entry.ts | 2 +- .../components/knowledge_base_edit_manual_entry_flyout.tsx | 1 - .../public/routes/components/knowledge_base_tab.test.tsx | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/ai_assistant_management/observability/public/hooks/use_create_knowledge_base_entry.ts b/src/plugins/ai_assistant_management/observability/public/hooks/use_create_knowledge_base_entry.ts index 5d367a8e66023..9c68437774255 100644 --- a/src/plugins/ai_assistant_management/observability/public/hooks/use_create_knowledge_base_entry.ts +++ b/src/plugins/ai_assistant_management/observability/public/hooks/use_create_knowledge_base_entry.ts @@ -29,7 +29,7 @@ export function useCreateKnowledgeBaseEntry() { { entry: Omit< KnowledgeBaseEntry, - '@timestamp' | 'confidence' | 'is_correction' | 'public' | 'labels' | 'role' + '@timestamp' | 'confidence' | 'is_correction' | 'public' | 'labels' | 'role' | 'doc_id' >; } >( diff --git a/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx b/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx index 80918e00a768d..aa973bb4db940 100644 --- a/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx +++ b/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx @@ -50,7 +50,6 @@ export function KnowledgeBaseEditManualEntryFlyout({ createEntry({ entry: { id: newEntryId, - doc_id: newEntryId, text: newEntryText, }, }).then(onClose); diff --git a/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_tab.test.tsx b/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_tab.test.tsx index a7abaca3210f6..4a5ad8daf96d5 100644 --- a/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_tab.test.tsx +++ b/src/plugins/ai_assistant_management/observability/public/routes/components/knowledge_base_tab.test.tsx @@ -80,7 +80,7 @@ describe('KnowledgeBaseTab', () => { getByTestId('knowledgeBaseEditManualEntryFlyoutSaveButton').click(); - expect(createMock).toHaveBeenCalledWith({ entry: { id: 'foo', doc_id: 'foo', text: '' } }); + expect(createMock).toHaveBeenCalledWith({ entry: { id: 'foo', text: '' } }); }); });