New Base func

This commit is contained in:
Jakob Wennberg
2026-02-19 09:48:02 +01:00
parent afc9f69def
commit cdf1dcc4c8
73 changed files with 11036 additions and 51 deletions
+10 -1
View File
@@ -1,6 +1,10 @@
import { createClient } from '@/lib/supabase/server'
import { NextResponse } from 'next/server'
import type { CreateCustomerInput } from '@/types'
import { eventBus } from '@/lib/events'
import { ensureInitialized } from '@/lib/init'
import type { CreateCustomerInput, Customer } from '@/types'
ensureInitialized()
export async function GET() {
const supabase = await createClient()
@@ -60,5 +64,10 @@ export async function POST(request: Request) {
return NextResponse.json({ error: error.message }, { status: 500 })
}
await eventBus.emit({
type: 'customer.created',
payload: { customer: data as Customer, userId: user.id },
})
return NextResponse.json({ data })
}