⚡ (engine) Improve engine overall robustness
This commit is contained in:
@ -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,
|
||||
|
@ -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({
|
||||
|
Reference in New Issue
Block a user