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:
parent
fc434ce6a8
commit
a74f533043
1 changed files with 3 additions and 1 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue