refac: file upload

This commit is contained in:
Timothy J. Baek 2024-01-07 09:00:30 -08:00
parent ffd0a5a2a0
commit d6a1bf1406
2 changed files with 11 additions and 7 deletions

View file

@ -124,8 +124,8 @@
reader.readAsDataURL(file);
} else if (['application/pdf', 'text/plain'].includes(file['type'])) {
console.log(file);
const hash = (await calculateSHA256(file)).substring(0, 63);
const res = await uploadDocToVectorDB(localStorage.token, hash, file);
// const hash = (await calculateSHA256(file)).substring(0, 63);
const res = await uploadDocToVectorDB(localStorage.token, '', file);
if (res) {
files = [
@ -243,8 +243,8 @@
reader.readAsDataURL(file);
} else if (['application/pdf', 'text/plain'].includes(file['type'])) {
console.log(file);
const hash = (await calculateSHA256(file)).substring(0, 63);
const res = await uploadDocToVectorDB(localStorage.token, hash, file);
// const hash = (await calculateSHA256(file)).substring(0, 63);
const res = await uploadDocToVectorDB(localStorage.token, '', file);
if (res) {
files = [