feat: refine exercise focus area retrieval in training planning
- Updated the SQL query in the training planning module to fetch the primary exercise focus area more efficiently. - Enhanced error handling in the API utility to provide clearer feedback on potential issues, including CORS and URL errors, improving debugging for developers.
This commit is contained in:
1 parent
131b7d591d
commit
23d4281058
2 files changed
+10
-2
No files matched your search
@@ -43,7 +43,9 @@ async function request(endpoint, options = {}) {
|
||||
API_URL && API_URL.length > 0
|
||||
? `Verbindung zum API unter ${API_URL} fehlgeschlagen. Läuft das Backend (z. B. Port 8098) und ist CORS erlaubt?`
|
||||
: 'Kein VITE_API_URL gesetzt: Anfragen gehen an die Frontend-URL und schlagen oft fehl. Setze in .env z. B. VITE_API_URL=http://localhost:8098 und starte Vite neu.'
|
||||
throw new Error(hint)
|
||||
// Ursache oft: CORS (v. a. bei Fehler-Antworten ohne CORS-Header), Adblocker, falsche URL —
|
||||
// Login kann trotzdem klappen wenn nur eine andere Route betroffen ist.
|
||||
throw new Error(`${hint} [Technisch: ${e.message}; URL war ${endpoint}]`)
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user