Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,10 @@ const SubBlockRow = ({
return null
}
const baseUrl = getBaseUrl()
const triggerPath = allSubBlockValues?.triggerPath?.value as string | undefined
return triggerPath
? `${baseUrl}/api/webhooks/trigger/${triggerPath}`
: `${baseUrl}/api/webhooks/trigger/${blockId}`
}, [subBlock?.id, blockId, allSubBlockValues])
// Always use blockId for consistency - the webhook path should always match blockId
// This prevents the URL from changing after loading webhook data
return `${baseUrl}/api/webhooks/trigger/${blockId}`
}, [subBlock?.id, blockId])

const allVariables = useVariablesStore((state) => state.variables)

Expand Down
10 changes: 4 additions & 6 deletions apps/sim/hooks/use-webhook-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ export function useWebhookManagement({
const isChecked = useSubBlockStore((state) => state.checkedWebhooks.has(blockId))

const webhookUrl = useMemo(() => {
if (!webhookPath) {
const baseUrl = getBaseUrl()
return `${baseUrl}/api/webhooks/trigger/${blockId}`
}
const baseUrl = getBaseUrl()
return `${baseUrl}/api/webhooks/trigger/${webhookPath}`
}, [webhookPath, blockId])
// Always use blockId for consistency - the webhook path should always match blockId
// This prevents the URL from changing after loading webhook data from the API
return `${baseUrl}/api/webhooks/trigger/${blockId}`
}, [blockId])

const [isSaving, setIsSaving] = useState(false)

Expand Down
Loading