fix: harden booking and meeting flows
This commit is contained in:
@@ -19,6 +19,7 @@ export async function POST(request: Request, { params }: Args) {
|
||||
let body: { participantId?: unknown };
|
||||
try {
|
||||
body = await request.json();
|
||||
if (!body || typeof body !== "object" || Array.isArray(body)) throw new Error("Invalid body");
|
||||
} catch {
|
||||
return NextResponse.json({ error: "Ungültige Anfrage." }, { status: 400 });
|
||||
}
|
||||
@@ -29,7 +30,7 @@ export async function POST(request: Request, { params }: Args) {
|
||||
|
||||
try {
|
||||
const roomService = getLiveKitRoomService();
|
||||
const room = getLiveKitRoomName(slug);
|
||||
const room = getLiveKitRoomName(slug, host.accessVersion);
|
||||
const participant = (await roomService.listParticipants(room)).find((item) => item.identity === participantId);
|
||||
if (!participant) return NextResponse.json({ error: "Teilnehmer nicht gefunden." }, { status: 404 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user