feat(storage): phase 5 — replace Supabase storage with local filesystem + HMAC evidence serving
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { getSession } from '@/lib/auth/get-session'
|
||||
import { validateIncidentInput, validateTypeDetails, type IncidentType, type MedicalStatus } from '@/lib/incidents/validate'
|
||||
import { uploadEvidenceFile } from '@/lib/supabase/storage'
|
||||
import { uploadEvidenceFile } from '@/lib/storage/evidence'
|
||||
import { sendNewIncidentEmail } from '@/lib/notifications/email'
|
||||
import { sendWhatsAppMessage } from '@/lib/notifications/whatsapp'
|
||||
import { createInAppNotifications } from '@/lib/notifications/in-app'
|
||||
@@ -148,12 +147,11 @@ async function handlePost(request: Request) {
|
||||
})
|
||||
})
|
||||
|
||||
// Evidence upload — storage still uses supabase (Phase 5 replaces this)
|
||||
const supabase = await createClient()
|
||||
// Evidence upload — local filesystem storage with HMAC-signed URLs
|
||||
const evidenceInserts: Array<typeof evidenceFiles.$inferInsert> = []
|
||||
for (const file of files) {
|
||||
try {
|
||||
const { publicUrl, hash } = await uploadEvidenceFile(supabase, file, incidentId, 'report', session.sub)
|
||||
const { publicUrl, hash } = await uploadEvidenceFile(file, incidentId, 'report', session.sub)
|
||||
evidenceInserts.push({
|
||||
incidentId,
|
||||
stage: 'report',
|
||||
|
||||
Reference in New Issue
Block a user