This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { defaultExtensions } from '@tegonhq/ui/components/ui/editor/editor-exten
44import { AI } from '@tegonhq/ui/icons' ;
55import { Editor } from '@tiptap/core' ;
66import { observer } from 'mobx-react-lite' ;
7+ import getConfig from 'next/config' ;
78import React , { useEffect , useRef } from 'react' ;
89
910import type { ConversationHistoryType } from 'common/types' ;
@@ -20,6 +21,8 @@ interface AIConversationItemProps {
2021 conversationHistory : ConversationHistoryType ;
2122}
2223
24+ const { publicRuntimeConfig } = getConfig ( ) ;
25+
2326export const ConversationItem = observer (
2427 ( { conversationHistory } : AIConversationItemProps ) => {
2528 const { user } = useUserData ( conversationHistory . userId ) ;
@@ -74,6 +77,7 @@ export const ConversationItem = observer(
7477 variant = "secondary"
7578 onClick = { ( ) => {
7679 runTasks ( {
80+ baseHost : publicRuntimeConfig . NEXT_PUBLIC_AI_HOST ,
7781 conversationId : conversationHistory . conversationId ,
7882 conversationHistoryId : conversationHistory . id ,
7983 workspaceId : workspace . id ,
Original file line number Diff line number Diff line change @@ -8,20 +8,22 @@ interface MutationParams {
88 onError ?: ( error : any ) => void ;
99}
1010interface RunTasksProps {
11+ baseHost : string ;
1112 conversationId : string ;
1213 conversationHistoryId : string ;
1314 taskIds : string [ ] ;
1415 workspaceId : string ;
1516}
1617
1718const runTasks = async ( {
19+ baseHost,
1820 conversationId,
1921 conversationHistoryId,
2022 taskIds,
2123 workspaceId,
2224} : RunTasksProps ) => {
2325 return axios ( {
24- url : `http://localhost:2000 /chat` ,
26+ url : `${ baseHost } /chat` ,
2527 withCredentials : true ,
2628 method : 'Post' ,
2729 data : {
You can’t perform that action at this time.
0 commit comments