Fix URL fetch to extract text from JSON response

Backend returns {text, url} object but frontend expected string.
Now properly extracts data.text field.
Fixes [object Object] display issue.

Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vadym Samoilenko 2026-02-27 22:36:34 +00:00
parent fc434ce6a8
commit a74f533043

View file

@ -129,7 +129,9 @@ export class WizardApi {
body: JSON.stringify({ url }),
cache: "no-cache",
});
return await ApiResponseHandler.handleResponse(response, "Failed to fetch URL");
const data = await ApiResponseHandler.handleResponse(response, "Failed to fetch URL");
// Backend returns {text: string, url: string}, extract just the text
return typeof data === 'string' ? data : (data.text || JSON.stringify(data));
}
/** Check if brief needs follow-up questions */