Analyse: Services-Route faellt bei Fehler der Analyse-Abfrage nicht aus

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 10:39:56 +00:00
1 parent 0b59dac2be
commit 2ca18f9c65
2 files changed
+25 -5

No files matched your search

+11 -5
View File
@@ -43,11 +43,17 @@ router.get('/', async (_req, res) => {
loadByIds(config.collections.workorders, projects.map((p) => p.ticketId)),
])
const analyseDocs = await listDocuments(config.collections.portalFeatures, [
Query.equal('featureKey', 'analyse'),
Query.limit(5000),
])
const analyseState = new Map((analyseDocs || []).map((d) => [d.projectId, d.state || 'off']))
// Ein Fehler hier darf die Services-Seite nicht kosten: dann ohne Analyse-Zustand
let analyseState = new Map()
try {
const analyseDocs = await listDocuments(config.collections.portalFeatures, [
Query.equal('featureKey', 'analyse'),
Query.limit(5000),
])
analyseState = new Map((analyseDocs || []).map((d) => [d.projectId, d.state || 'off']))
} catch (err) {
console.warn('[admin-services] Analyse-Zustände nicht geladen:', err.message)
}
const groups = {}
for (const p of projects) {