Bug ingestion status

This commit is contained in:
2025-03-27 15:05:46 +01:00
parent 35ba691dd9
commit 5ffc328bf7

View File

@@ -147,6 +147,7 @@ const filters = ref();
const userPrefStore = UserPrefStore();
const ksDocumentStore = KsDocumentStore();
const loadingStore = LoadingStore();
const fe_status = ref("");
const initFilters = () => {
filters.value = {
@@ -319,20 +320,20 @@ const confirmDeleteFromVectorStore = (id) => {
//ingestion
const startIndividualngestion = (id) => {
toast.add({ severity: 'info', summary: 'Info', detail: 'Starting Ingestion', life: 3000 });
fe_status = "IN PROGRESS"
fe_status.value = "IN PROGRESS"
axios.get(`/test/ingest_document/${id}`)
.then(response => {
if (response.data.status == "OK") {
toast.add({ severity: 'success', summary: 'Success', detail: 'Document ingestion started...', life: 3000 });
fe_status = "IN PROGRESS"
fe_status.value = "IN PROGRESS"
}
if (response.data.status == "ERROR") {
toast.add({ severity: 'error', summary: 'Success', detail: 'Error ingesting document:' + response.data.message, life: 3000 });
fe_status = "ERROR"
fe_status.value = "ERROR"
}
ksdocuments.value.forEach(element => {
if (element.id == id) {
element.ingestionStatus = fe_status
element.ingestionStatus = fe_status.value
console.log("Updated element", element)
}
});