Analyse: Routen fuer Portal und WOMS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 10:19:37 +00:00
1 parent 696f17b470
commit f4c8b291d7
7 files changed
+416 -16

No files matched your search

+3 -1
View File
@@ -183,12 +183,14 @@ export async function activateAnalyse({ customerId, projectId, accentColor, cons
})
}
export async function deactivateAnalyse({ customerId, projectId, now = new Date() }) {
export async function deactivateAnalyse({ customerId, projectId, now = new Date(), by = 'customer' }) {
return withLocks([`analyse:${projectId}`], async () => {
const project = await loadOwnProject(customerId, projectId)
if (!project) throw httpError(403, ELIGIBILITY_MESSAGES.nicht_dein_projekt)
const existing = await getFeatureDoc(customerId, projectId, FEATURE_KEY)
if (!existing || existing.state === 'off') return { doc: existing, changed: false }
// Von uns gesperrt: der Kunde darf daran nichts aendern (nur Mitarbeiter)
if (existing.state === 'disabled' && by === 'customer') return { doc: existing, changed: false }
if (existing.siteKey) {
await analyseDeps.client.putSite(existing.siteKey, { projectId, domains: analyseDomains(project), active: false })
}