@@ -32,9 +32,12 @@ import { VariableForTestInputs } from './VariableForTestInputs'
|
||||
import { SwitchWithRelatedSettings } from '@/components/SwitchWithRelatedSettings'
|
||||
import {
|
||||
HttpMethod,
|
||||
defaultTimeout,
|
||||
defaultWebhookAttributes,
|
||||
defaultWebhookBlockOptions,
|
||||
maxTimeout,
|
||||
} from '@typebot.io/schemas/features/blocks/integrations/webhook/constants'
|
||||
import { NumberInput } from '@/components/inputs'
|
||||
|
||||
type Props = {
|
||||
blockId: string
|
||||
@@ -81,6 +84,9 @@ export const WebhookAdvancedConfigForm = ({
|
||||
const updateIsCustomBody = (isCustomBody: boolean) =>
|
||||
onOptionsChange({ ...options, isCustomBody })
|
||||
|
||||
const updateTimeout = (timeout: number | undefined) =>
|
||||
onOptionsChange({ ...options, timeout })
|
||||
|
||||
const executeTestRequest = async () => {
|
||||
if (!typebot) return
|
||||
setIsTestResponseLoading(true)
|
||||
@@ -196,6 +202,22 @@ export const WebhookAdvancedConfigForm = ({
|
||||
)}
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<AccordionButton justifyContent="space-between">
|
||||
Advanced parameters
|
||||
<AccordionIcon />
|
||||
</AccordionButton>
|
||||
<AccordionPanel pt="4">
|
||||
<NumberInput
|
||||
label="Timeout (s)"
|
||||
defaultValue={options?.timeout ?? defaultTimeout}
|
||||
min={1}
|
||||
max={maxTimeout}
|
||||
onValueChange={updateTimeout}
|
||||
withVariableButton={false}
|
||||
/>
|
||||
</AccordionPanel>
|
||||
</AccordionItem>
|
||||
<AccordionItem>
|
||||
<AccordionButton justifyContent="space-between">
|
||||
Variable values for test
|
||||
|
||||
9
apps/builder/src/pages/api/test.ts
Normal file
9
apps/builder/src/pages/api/test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next'
|
||||
|
||||
export default async function handler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
await new Promise((resolve) => setTimeout(resolve, 11000))
|
||||
res.status(200).json({ name: 'John Doe' })
|
||||
}
|
||||
Reference in New Issue
Block a user