fix: correct predictions poll URL in studio muapi client

PROXY_APP_BASE ('/api/app') produced /api/app/v1/predictions/... which
after the Next.js rewrite hit 127.0.0.1:8000/app/v1/... → 404.
Poll now uses BASE_URL directly, consistent with how submit works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Anil Matcha 2026-04-22 12:04:52 +05:30
parent aa6917e339
commit 9de0de3430

View file

@ -1,11 +1,10 @@
import { getModelById, getVideoModelById, getI2IModelById, getI2VModelById, getV2VModelById, getLipSyncModelById } from './models.js';
const BASE_URL = 'https://api.muapi.ai'; // Legacy direct URL
const PROXY_APP_BASE = '/api/app';
const BASE_URL = 'https://api.muapi.ai';
const PROXY_WF_BASE = '/api/workflow';
async function pollForResult(requestId, key, maxAttempts = 900, interval = 2000) {
const pollUrl = `${PROXY_APP_BASE}/v1/predictions/${requestId}/result`;
const pollUrl = `${BASE_URL}/api/v1/predictions/${requestId}/result`;
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
await new Promise(resolve => setTimeout(resolve, interval));
try {