fix: stabilize build and archive configs
This commit is contained in:
@@ -102,7 +102,7 @@ export async function PUT(
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: 'Validatiefout',
|
||||
details: result.error.errors.map(e => ({
|
||||
details: result.error.issues.map(e => ({
|
||||
field: e.path.join('.'),
|
||||
message: e.message,
|
||||
})),
|
||||
|
||||
@@ -13,9 +13,7 @@ import { z } from 'zod';
|
||||
const CreateIntakeSchema = z.object({
|
||||
patient_id: z.string().uuid('Patient ID moet een geldige UUID zijn'),
|
||||
title: z.string().min(1, 'Titel is verplicht'),
|
||||
department: z.enum(['Volwassenen', 'Jeugd', 'Ouderen'], {
|
||||
errorMap: () => ({ message: 'Afdeling moet Volwassenen, Jeugd of Ouderen zijn' }),
|
||||
}),
|
||||
department: z.enum(['Volwassenen', 'Jeugd', 'Ouderen']),
|
||||
start_date: z.string().min(1, 'Startdatum is verplicht'),
|
||||
psychologist_id: z.string().uuid().optional(),
|
||||
notes: z.string().optional(),
|
||||
@@ -96,7 +94,7 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: 'Validatiefout',
|
||||
details: result.error.errors.map(e => ({
|
||||
details: result.error.issues.map(e => ({
|
||||
field: e.path.join('.'),
|
||||
message: e.message,
|
||||
})),
|
||||
|
||||
@@ -38,13 +38,15 @@ export async function DELETE(
|
||||
return NextResponse.json({ error: 'Document niet gevonden' }, { status: 404 });
|
||||
}
|
||||
|
||||
const { error: deleteError } = await supabaseAdmin.storage
|
||||
.from(BUCKET)
|
||||
.remove([document.file_path]);
|
||||
if (document.file_path) {
|
||||
const { error: deleteError } = await supabaseAdmin.storage
|
||||
.from(BUCKET)
|
||||
.remove([document.file_path]);
|
||||
|
||||
if (deleteError) {
|
||||
console.error('Storage delete error:', deleteError);
|
||||
// Don't stop here; attempt DB delete even if storage failed
|
||||
if (deleteError) {
|
||||
console.error('Storage delete error:', deleteError);
|
||||
// Don't stop here; attempt DB delete even if storage failed
|
||||
}
|
||||
}
|
||||
|
||||
const { error: dbError } = await supabase
|
||||
|
||||
@@ -14,7 +14,7 @@ async function ensureBucket() {
|
||||
if (createError && !createError.message.includes('already exists')) {
|
||||
throw createError;
|
||||
}
|
||||
} else if (error && !error.message.includes('not found')) {
|
||||
} else if (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getIntakeById } from '../../actions';
|
||||
import { getIntakeById } from '../actions';
|
||||
import { IntakeHeader } from './components/intake-header';
|
||||
import { IntakeTabs } from './components/intake-tabs';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
Reference in New Issue
Block a user