fix: workflow execution on api call with /api/providers error

This commit is contained in:
Emir Karabeg
2025-04-11 00:54:23 -07:00
parent 6482e5fba6
commit a45b59ec02
+4 -1
View File
@@ -160,8 +160,11 @@ export class AgentBlockHandler implements BlockHandler {
hasApiKey: !!providerRequest.apiKey,
})
// Get the app URL from environment variable or use default
const appUrl = process.env.NEXT_PUBLIC_APP_URL
try {
const response = await fetch('/api/providers', {
const response = await fetch(`${appUrl ? appUrl : ''}/api/providers`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',