fix: updated from 9.3.3 to 15
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user