fix: improve plugins functionality with server management

This commit is contained in:
2026-04-29 20:33:54 +02:00
parent b8f6d58d99
commit fa2cca6fa4
82 changed files with 1708 additions and 303 deletions

View File

@@ -3,8 +3,15 @@ import { RoomEntity } from '../../../entities';
import { GetRoomQuery } from '../../types';
import { rowToRoom } from '../../mappers';
import { loadRoomRelationsMap } from '../../relations';
import { getCurrentUserScope, userOwnsRoom } from '../../current-user-scope';
export async function handleGetRoom(query: GetRoomQuery, dataSource: DataSource) {
const currentUserId = await getCurrentUserScope(dataSource);
if (!await userOwnsRoom(dataSource, query.payload.roomId, currentUserId)) {
return null;
}
const repo = dataSource.getRepository(RoomEntity);
const row = await repo.findOne({ where: { id: query.payload.roomId } });