feat: add admin dashboard and core API routes with Docker configuration
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { getAuthUser } from '@/lib/auth-utils'
|
||||
|
||||
// POST /api/messages — Send a message or start a conversation
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const userId = request.headers.get('x-user-id')
|
||||
const authUser = await getAuthUser(request)
|
||||
const { businessId, conversationId, content } = await request.json()
|
||||
|
||||
if (!userId) {
|
||||
if (!authUser) {
|
||||
return NextResponse.json({ error: 'Utilisateur non identifié' }, { status: 401 })
|
||||
}
|
||||
|
||||
const userId = authUser.id
|
||||
|
||||
if (!content) {
|
||||
return NextResponse.json({ error: 'Contenu manquant' }, { status: 400 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user