diff --git a/api/src/libs/indexer.js b/api/src/libs/indexer.js index 17b4023a..05972876 100644 --- a/api/src/libs/indexer.js +++ b/api/src/libs/indexer.js @@ -49,7 +49,7 @@ class Indexer { // Check if the item is a webpage and has no content then return Exception if ( indexItem.item.__typename === "WebPage" && - indexItem.item.WebPage_content === "" + (!indexItem.item.WebPage_content || indexItem.item.WebPage_content === "") ) { logger.warn( "Step [0]: No content found, createIndexItem event incomplete", diff --git a/web-app/src/components/site/indexes/AskIndexes/index.tsx b/web-app/src/components/site/indexes/AskIndexes/index.tsx index 3ffee487..cd4ba19e 100644 --- a/web-app/src/components/site/indexes/AskIndexes/index.tsx +++ b/web-app/src/components/site/indexes/AskIndexes/index.tsx @@ -70,7 +70,7 @@ const AskIndexes: FC = ({ chatID, sources }) => { }, [fetchDefaultQuestions]); - const socketUrl = `${process.env.NEXT_PUBLIC_API_URL.replace(/^https/, 'ws')}${API_ENDPOINTS.DISCOVERY_UPDATES}`; + const socketUrl = `${process.env.NEXT_PUBLIC_API_URL.replace(/^https/, 'ws')}${API_ENDPOINTS.DISCOVERY_UPDATES.replace(":chatID", chatID)}`; const ws = new WebSocket(socketUrl); ws.onmessage = async (event) => { console.log(event); diff --git a/web-app/src/services/api-service-new.ts b/web-app/src/services/api-service-new.ts index 8321745a..242925f4 100644 --- a/web-app/src/services/api-service-new.ts +++ b/web-app/src/services/api-service-new.ts @@ -8,7 +8,7 @@ const API_ENDPOINTS = { CHAT_STREAM: "/chat_stream", INDEXES: "/indexes/:id", DEFAULT_QUESTIONS_OF_INDEX: "/discovery/questions", - DISCOVERY_UPDATES: "/discovery/:chatId/updates", + DISCOVERY_UPDATES: "/discovery/:chatID/updates", GET_ALL_INDEXES: "/dids/:did/indexes", CREATE_INDEX: "/indexes", UPDATE_INDEX: "/indexes/:id", diff --git a/web-app/src/utils/constants.ts b/web-app/src/utils/constants.ts index 8b500a62..b2ea4deb 100644 --- a/web-app/src/utils/constants.ts +++ b/web-app/src/utils/constants.ts @@ -11,6 +11,7 @@ export const DEFAULT_CREATE_LINK_TITLE = "Untitled Link"; export const API_ENDPOINTS = { CHAT_STREAM: "discovery/chat", + DISCOVERY_UPDATES: "/discovery/:chatID/updates", INDEXES: "/indexes", GET_ALL_INDEXES: "/dids/:id/indexes", GET_PROFILE: "/dids/:id/profile",