mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: added player list api
This commit is contained in:
1 parent
33b4ea04b4
commit
cbeb83d8d0
7 files changed
+57
-17
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import listPlayers from '../../../../core/blitz/listPlayers';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const search = request.nextUrl.searchParams.get('search');
|
||||
const limitParam = request.nextUrl.searchParams.get('limit');
|
||||
const limit = limitParam ? parseInt(limitParam) : undefined;
|
||||
const players = search ? await listPlayers(search, limit) : [];
|
||||
|
||||
return NextResponse.json(players);
|
||||
}
|
||||
Reference in new issue
Block a user