Fix QuickCreate AI request payload
This commit is contained in:
parent
73803f894b
commit
153eb728e2
14
RELEASE_NOTES_v2.2.63.md
Normal file
14
RELEASE_NOTES_v2.2.63.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Release Notes v2.2.63
|
||||
|
||||
Dato: 18. marts 2026
|
||||
|
||||
## Fixes
|
||||
|
||||
- Rettet QuickCreate AI-analyse request i frontend.
|
||||
- `POST /api/v1/sag/analyze-quick-create` får nu korrekt payload med både `text` og `user_id` i body.
|
||||
- Forbedret fejllog i frontend ved AI-fejl (inkl. HTTP status), så fejl ikke bliver skjult som generisk "Analysis failed".
|
||||
|
||||
## Berørte filer
|
||||
|
||||
- `app/shared/frontend/quick_create_modal.html`
|
||||
- `RELEASE_NOTES_v2.2.63.md`
|
||||
@ -303,15 +303,19 @@
|
||||
async function performAnalysis(text) {
|
||||
try {
|
||||
const userId = getUserId();
|
||||
const response = await fetch(`/api/v1/sag/analyze-quick-create?user_id=${userId}`, {
|
||||
const response = await fetch('/api/v1/sag/analyze-quick-create', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({text})
|
||||
body: JSON.stringify({
|
||||
text,
|
||||
user_id: parseInt(userId, 10)
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Analysis failed');
|
||||
const errorText = await response.text();
|
||||
throw new Error(`Analysis failed (${response.status}): ${errorText || 'unknown error'}`);
|
||||
}
|
||||
|
||||
const analysis = await response.json();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user