Enhance environment configuration and expand Prisma schema for bot management
- Added OWNER_USER_IDS to .env.example for specifying global bot owners. - Introduced new models in the Prisma schema: CommandOverride, OwnerTeamMember, GlobalUserBlacklist, GuildBlacklist, FeatureFlag, BotPresenceConfig, ChangelogEntry, and OwnerAuditLog to support advanced bot management features. - Updated env.ts to preprocess OWNER_USER_IDS for better handling of global bot owner IDs. - Modified ModulePlaceholderPage to ensure proper routing for remaining dashboard modules.
This commit is contained in:
25
apps/webui/src/app/api/guilds/[guildId]/cases/route.ts
Normal file
25
apps/webui/src/app/api/guilds/[guildId]/cases/route.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { CaseListQuerySchema } from '@nexumi/shared';
|
||||
import { type NextRequest, NextResponse } from 'next/server';
|
||||
import { requireGuildAccess, toApiErrorResponse } from '@/lib/auth';
|
||||
import { listCases } from '@/lib/module-configs/cases';
|
||||
|
||||
interface RouteParams {
|
||||
params: Promise<{ guildId: string }>;
|
||||
}
|
||||
|
||||
export async function GET(request: NextRequest, { params }: RouteParams) {
|
||||
const { guildId } = await params;
|
||||
try {
|
||||
await requireGuildAccess(guildId);
|
||||
const searchParams = request.nextUrl.searchParams;
|
||||
const query = CaseListQuerySchema.parse({
|
||||
search: searchParams.get('search') ?? undefined,
|
||||
action: searchParams.get('action') ?? undefined,
|
||||
limit: searchParams.get('limit') ?? undefined
|
||||
});
|
||||
const cases = await listCases(guildId, query);
|
||||
return NextResponse.json({ cases });
|
||||
} catch (error) {
|
||||
return toApiErrorResponse(error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user