Nice and stable before liveview

This commit is contained in:
2025-10-29 20:38:39 +00:00
parent 76586c0df2
commit 4a8d6bc5d7
21 changed files with 1135 additions and 270 deletions
+22
View File
@@ -0,0 +1,22 @@
// app/api/events/cars/route.ts
// API endpoint to get available cars from server config
import { NextResponse } from 'next/server';
import { getAvailableCars } from '@/lib/serverConfig';
export async function GET() {
try {
const cars = await getAvailableCars();
return NextResponse.json({
success: true,
data: cars,
});
} catch (error) {
console.error('Error fetching cars:', error);
return NextResponse.json(
{ success: false, error: 'Failed to load available cars' },
{ status: 500 }
);
}
}
+2 -3
View File
@@ -20,16 +20,15 @@ export async function POST(request: Request) {
}
// Validate steamId format to prevent SQL injection
const steamId = inputSteamId.trim(); // just in case
const driverGuid = steamId.trim(); // just in case
if (!/^[0-9]{15,20}$/.test(steamId)) {
if (!/^[0-9]{15,20}$/.test(driverGuid)) {
return NextResponse.json(
{ success: false, error: "Invalid Steam ID format" },
{ status: 400 }
);
}
const driverGuid = steamId;
console.log('Parsed driver GUID:', driverGuid);
if (isNaN(driverGuid)) {
return NextResponse.json(