- Updated RootLayout to include locale support and integrated ThemeProvider and LocaleProvider for better internationalization. - Replaced static home page content with a redirect based on user session status, enhancing user experience by directing to the appropriate dashboard or login page. - Switched font from Geist to Inter for improved typography consistency.
21 lines
756 B
TypeScript
21 lines
756 B
TypeScript
import { type NextRequest, NextResponse } from 'next/server';
|
|
import { requireGuildAccess, toApiErrorResponse } from '@/lib/auth';
|
|
import { listRecentDashboardAudit } from '@/lib/audit';
|
|
|
|
interface RouteParams {
|
|
params: Promise<{ guildId: string }>;
|
|
}
|
|
|
|
export async function GET(request: NextRequest, { params }: RouteParams) {
|
|
const { guildId } = await params;
|
|
try {
|
|
await requireGuildAccess(guildId);
|
|
const limitParam = request.nextUrl.searchParams.get('limit');
|
|
const limit = limitParam ? Math.min(Math.max(Number.parseInt(limitParam, 10) || 10, 1), 50) : 10;
|
|
const entries = await listRecentDashboardAudit(guildId, limit);
|
|
return NextResponse.json({ entries });
|
|
} catch (error) {
|
|
return toApiErrorResponse(error);
|
|
}
|
|
}
|