ac8eb1bf99
Chat-Verlauf wird als strukturiertes Beratungsprotokoll per Email an den DSB gesendet. Button erscheint im Header sobald Nachrichten vorhanden sind. Zeigt Checkmark nach erfolgreichem Versand. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
31 lines
959 B
TypeScript
31 lines
959 B
TypeScript
/**
|
|
* Agent Notify API Proxy
|
|
* POST /api/sdk/v1/agent/notify → backend-compliance /api/compliance/agent/notify
|
|
*/
|
|
|
|
import { NextRequest, NextResponse } from 'next/server'
|
|
|
|
const BACKEND_URL = process.env.BACKEND_API_URL || 'http://backend-compliance:8002'
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const body = await request.text()
|
|
const response = await fetch(`${BACKEND_URL}/api/compliance/agent/notify`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body,
|
|
signal: AbortSignal.timeout(15000),
|
|
})
|
|
|
|
if (!response.ok) {
|
|
const errorText = await response.text()
|
|
return NextResponse.json({ error: errorText }, { status: response.status })
|
|
}
|
|
|
|
return NextResponse.json(await response.json())
|
|
} catch (error) {
|
|
console.error('Agent notify proxy error:', error)
|
|
return NextResponse.json({ error: 'Email-Versand fehlgeschlagen' }, { status: 503 })
|
|
}
|
|
}
|