2
0

(engine) Improve engine overall robustness

This commit is contained in:
Baptiste Arnaud
2023-01-25 11:27:47 +01:00
parent ff62b922a0
commit 30baa611e5
210 changed files with 1820 additions and 1919 deletions

View File

@ -1,6 +1,7 @@
import { InitialChatReply } from '@/types'
import { SendMessageInput, StartParams } from 'models'
import { getViewerUrl, isEmpty, sendRequest } from 'utils'
import { guessApiHost } from '@/utils/guessApiHost'
import type { SendMessageInput, StartParams } from 'models'
import { isNotEmpty, sendRequest } from 'utils'
export async function getInitialChatReplyQuery({
typebot,
@ -17,7 +18,7 @@ export async function getInitialChatReplyQuery({
return sendRequest<InitialChatReply>({
method: 'POST',
url: `${isEmpty(apiHost) ? getViewerUrl() : apiHost}/api/v1/sendMessage`,
url: `${isNotEmpty(apiHost) ? apiHost : guessApiHost()}/api/v1/sendMessage`,
body: {
startParams: {
isPreview,

View File

@ -1,4 +1,4 @@
import { ChatReply, SendMessageInput } from 'models'
import type { ChatReply, SendMessageInput } from 'models'
import { getViewerUrl, isEmpty, sendRequest } from 'utils'
export async function sendMessageQuery({