fix: updated from 9.3.3 to 15

This commit is contained in:
2026-05-19 20:22:37 +01:00
parent 27806f438f
commit 8589c83fb8
18 changed files with 45 additions and 76 deletions
+1 -22
View File
@@ -43,7 +43,7 @@ export async function GET(request: Request) {
const rows = await query(sql);
// Transform to proper structure
const drivers: DriverWithServer[] = rows.map((row: any) => ({
const drivers: DriverWithServer[] = rows.map((row: unkown) => ({
driver_guid: row.driver_guid,
driver_name: row.driver_name,
driver_team: row.driver_team,
@@ -85,24 +85,3 @@ export async function GET(request: Request) {
);
}
}
// POST endpoint for updating driver data (optional, for future use)
export async function POST(request: Request) {
try {
const body = await request.json();
// Add your update logic here
// Example: Update driver rank, stats, etc.
return NextResponse.json({
success: true,
message: 'Driver updated',
});
} catch (error) {
console.error('Error updating driver:', error);
return NextResponse.json(
{ success: false, error: 'Failed to update driver' },
{ status: 500 }
);
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ export async function POST(request: Request) {
}
// Check if event exists and is open
const eventCheck: any = await queryOne(
const eventCheck: unknown = await queryOne(
`SELECT event_id, event_status, max_participants,
(SELECT COUNT(*) FROM event_registrations
WHERE event_id = $1 AND status = 'REGISTERED') as current_registrations
+3 -3
View File
@@ -31,7 +31,7 @@ async function updateRankCache() {
);
rankCache.clear();
users.forEach((row: any) => {
users.forEach((row: unknown) => {
rankCache.set(row.driver_guid.toString(), {
rank: row.rank_position,
rating: row.user_rank
@@ -112,7 +112,7 @@ export async function GET(request: Request) {
const heartbeat = setInterval(() => {
try {
controller.enqueue(encoder.encode(`: heartbeat\n\n`));
} catch (error) {
} catch {
clearInterval(heartbeat);
}
}, 30000);
@@ -124,7 +124,7 @@ export async function GET(request: Request) {
clearInterval(heartbeat);
try {
controller.close();
} catch (error) {
} catch {
// Controller already closed
}
});