mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 09:09:53 +00:00
Merge pull request #3972 from jonathan-rohde/fix/missing-tags-add-doc-modal
fix: missing tags add doc modal
This commit is contained in:
commit
376b2d0297
@ -35,12 +35,12 @@
|
||||
SUPPORTED_FILE_TYPE.includes(file['type']) ||
|
||||
SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
|
||||
) {
|
||||
uploadDoc(file);
|
||||
uploadDoc(file, tags);
|
||||
} else {
|
||||
toast.error(
|
||||
`Unknown File Type '${file['type']}', but accepting and treating as plain text`
|
||||
);
|
||||
uploadDoc(file);
|
||||
uploadDoc(file, tags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
await documents.set(await getDocs(localStorage.token));
|
||||
};
|
||||
|
||||
const uploadDoc = async (file) => {
|
||||
const uploadDoc = async (file, tags?: object) => {
|
||||
console.log(file);
|
||||
// Check if the file is an audio file and transcribe/convert it to text file
|
||||
if (['audio/mpeg', 'audio/wav'].includes(file['type'])) {
|
||||
@ -84,7 +84,12 @@
|
||||
res.collection_name,
|
||||
res.filename,
|
||||
transformFileName(res.filename),
|
||||
res.filename
|
||||
res.filename,
|
||||
tags?.length > 0
|
||||
? {
|
||||
tags: tags
|
||||
}
|
||||
: null
|
||||
).catch((error) => {
|
||||
toast.error(error);
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user