fix: API Routes — Ergebnisprüfung, Suppression-Check vor Enqueue, Bulk-Enqueue, Status-Codes, Draft-Guard
- getTenantId in shared Utility src/lib/tenant-header.ts ausgelagert (alle 4 Route-Dateien) - send/route.ts: updateCampaignStatus-Ergebnis geprüft (C1), addBulk statt sequentiellem await (C2), Suppression-Check vor Enqueue (C3) - [id]/route.ts: GET unterscheidet 404/500, PATCH unterscheidet 404/400 - schedule/route.ts: immediate-Typ abgelehnt (I4), Draft-Guard hinzugefügt (I5) - .eslintrc.json ergänzt (next/core-web-vitals) — fehlte im Projekt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { CreateCampaignSchema } from '../../../lib/validation'
|
||||
import { createCampaign, listCampaigns } from '../../../server/db/campaigns'
|
||||
|
||||
function getTenantId(req: NextRequest): string {
|
||||
return req.headers.get('x-tenant-id') ?? 'default'
|
||||
}
|
||||
import { getTenantId } from '../../../lib/tenant-header'
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
const tenantId = getTenantId(req)
|
||||
|
||||
Reference in New Issue
Block a user