Skip to content

Commit

Permalink
[fix]: get chat bot detail (#347)
Browse files Browse the repository at this point in the history
* fix(icon): fix icon type error

* fix(chat): fix bot id is new but still get config
  • Loading branch information
ch-liuzhide authored Sep 5, 2024
1 parent 95216a5 commit 2b63266
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/app/factory/edit/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ export default function Edit({ params }: { params: { id: string } }) {
[params?.id, botProfile?.id],
);

const botId = useMemo(() => {
if (!!params?.id && params?.id !== 'new') {
return params.id;
} else if (!!botProfile?.id) {
return botProfile.id;
} else {
return undefined;
}
}, [params?.id, botProfile?.id]);

const { data: config, isLoading } = useBotConfig(
params?.id,
!!params?.id && params?.id !== 'new',
Expand Down Expand Up @@ -451,7 +461,7 @@ export default function Edit({ params }: { params: { id: string } }) {
style={{
backgroundColor: '#FCFCFC',
}}
token={params.id}
token={botId}
apiDomain={API_HOST}
apiUrl="/api/chat/stream_qa"
prompt={botProfile?.prompt}
Expand Down

0 comments on commit 2b63266

Please sign in to comment.