"vscode:/vscode.git/clone" did not exist on "772777c3228e5b2e2a59145f2b05f9ad7b6547a1"
Unverified Commit 878d12da authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #3946 from open-webui/dev

fix
parents 6668d795 c1dfafcc
......@@ -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) {
......
......@@ -205,7 +205,7 @@
<EditDocModal bind:show={showEditDocModal} {selectedDoc} />
{/key}
<AddDocModal bind:show={showAddDocModal} />
<AddDocModal bind:show={showAddDocModal} {uploadDoc} />
<div class="mb-3">
<div class="flex justify-between items-center">
......
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