feat: removed non-proxy apis

This commit is contained in:
TrèsAbhi committed 2023-09-23 19:20:29 -05:00
1 parent 925ac96264
commit 6ff2a23ff7
11 files changed
+54 -65

No files matched your search

-11
View File
@@ -1,11 +0,0 @@
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);
}
@@ -1,16 +0,0 @@
import { NextRequest, NextResponse } from 'next/server';
import { Region } from '../../../../../constants/regions';
import getTankStats from '../../../../../core/blitz/getTankStats';
import { NormalizedTankStats } from '../../../../../types/tanksStats';
export async function GET(request: NextRequest) {
const region = request.nextUrl.searchParams.get('region') as Region;
const id = parseInt(request.nextUrl.searchParams.get('id')!);
const tankStats = await getTankStats(region, id);
const normalized = tankStats.reduce<NormalizedTankStats>(
(accumulator, tank) => ({ ...accumulator, [tank.tank_id]: tank }),
{},
);
return NextResponse.json(normalized);
}
+6
View File
@@ -0,0 +1,6 @@
import { NextResponse } from 'next/server';
import { tankopedia } from '../../../core/blitz/tankopedia';
export async function GET() {
return NextResponse.json(await tankopedia);
}