first commit
This commit is contained in:
commit
69b647145f
58 files changed
+15796
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import { prisma } from '../../utils/db'
|
||||
import { getMemberCount, getStreamCount } from '../../utils/runtimeRooms'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const roomId = getRouterParam(event, 'roomId')
|
||||
if (!roomId) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Room id required' })
|
||||
}
|
||||
|
||||
const room = await prisma.room.findUnique({ where: { id: roomId } })
|
||||
if (!room) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Room not found' })
|
||||
}
|
||||
|
||||
return {
|
||||
id: room.id,
|
||||
name: room.name,
|
||||
memberCount: getMemberCount(room.id),
|
||||
streamCount: getStreamCount(room.id),
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user