feat: add standalone admin video call test

This commit is contained in:
2026-09-16 21:41:43 +02:00
parent 906ea764ac
commit 8f5a074716
4 changed files with 134 additions and 20 deletions
@@ -23,9 +23,12 @@ export async function POST(request: Request, { params }: Args) {
}
try {
const payload = await getPayload({ config });
const { docs } = await payload.find({ collection: "events", where: { slug: { equals: slug } }, limit: 1 });
if (!docs[0]?.isOnline) return NextResponse.json({ error: "Dieser Online-Termin wurde nicht gefunden." }, { status: 404 });
const isAdminTestRoom = meetingToken.role === "host" && slug.startsWith("test-");
if (!isAdminTestRoom) {
const payload = await getPayload({ config });
const { docs } = await payload.find({ collection: "events", where: { slug: { equals: slug } }, limit: 1 });
if (!docs[0]?.isOnline) return NextResponse.json({ error: "Dieser Online-Termin wurde nicht gefunden." }, { status: 404 });
}
const participantToken = await createLiveKitToken({
eventSlug: slug,