From c1dfafcc9e65bede679d178fde5c4ba5b5ba64ab Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 17:18:57 +0200 Subject: [PATCH] fix --- .../components/documents/AddDocModal.svelte | 27 +------------------ src/lib/components/workspace/Documents.svelte | 2 +- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/src/lib/components/documents/AddDocModal.svelte b/src/lib/components/documents/AddDocModal.svelte index b3c550c3f..147d3d91b 100644 --- a/src/lib/components/documents/AddDocModal.svelte +++ b/src/lib/components/documents/AddDocModal.svelte @@ -16,6 +16,7 @@ const i18n = getContext('i18n'); export let show = false; + export let uploadDoc: Function; let uploadDocInputElement: HTMLInputElement; let inputFiles; let tags = []; @@ -26,32 +27,6 @@ content: null }; - const uploadDoc = async (file) => { - const res = await uploadDocToVectorDB(localStorage.token, '', file).catch((error) => { - toast.error(error); - return null; - }); - - if (res) { - await createNewDoc( - localStorage.token, - res.collection_name, - res.filename, - transformFileName(res.filename), - res.filename, - tags.length > 0 - ? { - tags: tags - } - : null - ).catch((error) => { - toast.error(error); - return null; - }); - await documents.set(await getDocs(localStorage.token)); - } - }; - const submitHandler = async () => { if (inputFiles && inputFiles.length > 0) { for (const file of inputFiles) { diff --git a/src/lib/components/workspace/Documents.svelte b/src/lib/components/workspace/Documents.svelte index 87873278c..635753d1a 100644 --- a/src/lib/components/workspace/Documents.svelte +++ b/src/lib/components/workspace/Documents.svelte @@ -205,7 +205,7 @@ {/key} - +