Merge pull request #466 from baumandm/feat/epub-support

feat: Add epub support
This commit is contained in:
Timothy Jaeryang Baek
2024-01-22 23:12:46 -08:00
committed by GitHub
6 changed files with 37 additions and 11 deletions

View File

@@ -121,13 +121,19 @@
error: ''
};
files = [...files, doc];
const res = await uploadDocToVectorDB(localStorage.token, '', file);
try {
files = [...files, doc];
const res = await uploadDocToVectorDB(localStorage.token, '', file);
if (res) {
doc.upload_status = true;
doc.collection_name = res.collection_name;
files = files;
if (res) {
doc.upload_status = true;
doc.collection_name = res.collection_name;
files = files;
}
} catch (e) {
// Remove the failed doc from the files array
files = files.filter((f) => f.name !== file.name);
toast.error(e);
}
};