diff --git a/src/generated_scene/generator.rs b/src/generated_scene/generator.rs index ca2d1a1..0285e97 100644 --- a/src/generated_scene/generator.rs +++ b/src/generated_scene/generator.rs @@ -306,18 +306,12 @@ function validateArgs(args) {{ }} function buildRequest(args, endpoint) {{ - const url = new URL(endpoint.url, window.location.origin); - const params = {{ ...STATIC_PARAMS, ...args }}; - for (const [key, value] of Object.entries(params)) {{ - if (value !== undefined && value !== null) {{ - url.searchParams.set(key, String(value)); - }} - }} - return {{ - url: url.toString(), - method: endpoint.method || 'GET', - headers: {{ 'Content-Type': 'application/json' }} - }}; + // Use endpoint.url directly - it's already a complete URL + const url = endpoint.url; + const method = endpoint.method || 'POST'; + const headers = {{ 'Content-Type': 'application/json' }}; + const body = JSON.stringify({{ ...STATIC_PARAMS, ...args }}); + return {{ url, method, headers, body }}; }} function normalizeRows(rawData) {{ @@ -360,7 +354,8 @@ const defaultDeps = {{ const request = buildRequest(args, endpoint); const response = await fetch(request.url, {{ method: request.method, - headers: request.headers + headers: request.headers, + body: request.body }}); if (!response.ok) throw new Error(`HTTP ${{response.status}}: ${{response.statusText}}`); return response.json();