From 153eb728e2c89a53334701b402f0c362e9e59ae4 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Mar 2026 10:25:47 +0100 Subject: [PATCH] Fix QuickCreate AI request payload --- RELEASE_NOTES_v2.2.63.md | 14 ++++++++++++++ app/shared/frontend/quick_create_modal.html | 10 +++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 RELEASE_NOTES_v2.2.63.md diff --git a/RELEASE_NOTES_v2.2.63.md b/RELEASE_NOTES_v2.2.63.md new file mode 100644 index 0000000..9199888 --- /dev/null +++ b/RELEASE_NOTES_v2.2.63.md @@ -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` diff --git a/app/shared/frontend/quick_create_modal.html b/app/shared/frontend/quick_create_modal.html index c7fb4c1..0e0d5be 100644 --- a/app/shared/frontend/quick_create_modal.html +++ b/app/shared/frontend/quick_create_modal.html @@ -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();