managing rsvps

This commit is contained in:
briannelson95
2025-06-28 20:23:22 -04:00
parent dee9066c91
commit 28efa115ad
19 changed files with 568 additions and 197 deletions

View File

@@ -3,14 +3,14 @@ import { mutations } from '@/lib/mutations'
export async function POST(req: NextRequest, { params }: { params: { eventId: string } }) {
const eventId = params.eventId
const { guestBookEntryId } = await req.json()
const { guestId } = await req.json() // ← match client
if (!eventId || !guestBookEntryId) {
return NextResponse.json({ message: 'Missing eventId or guestBookEntryId' }, { status: 400 })
if (!eventId || !guestId) {
return NextResponse.json({ message: 'Missing eventId or guestId' }, { status: 400 })
}
try {
const added = await mutations.addEventGuest({ eventId, guestBookEntryId })
const added = await mutations.addEventGuest({ eventId, guestBookEntryId: guestId }) // ← match expected arg
return NextResponse.json(added)
} catch (error) {
console.error('Add Event Guest Error:', error)