feat(ui): hide spoiler banner, anonymize claims, optional guest name, list wishlists on home, drop esgotados toggle
This commit is contained in:
@@ -16,10 +16,7 @@ export async function POST(request: NextRequest) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
|
||||
}
|
||||
const body = await request.json().catch(() => ({}));
|
||||
const name = (body?.name ?? '').toString().trim();
|
||||
if (!name) {
|
||||
return NextResponse.json({ error: 'name is required' }, { status: 400 });
|
||||
}
|
||||
const name = (body?.name ?? '').toString().trim() || 'Convidado';
|
||||
const [row] = await db.insert(guests).values({ name }).returning();
|
||||
return NextResponse.json({ success: true, guest: row }, { status: 201 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user