fix: updated from 9.3.3 to 15

This commit is contained in:
2026-06-17 17:49:00 +01:00
parent 8589c83fb8
commit e9555c9f74
9 changed files with 545 additions and 445 deletions
+9 -6
View File
@@ -3,6 +3,7 @@
import { NextResponse } from 'next/server';
import { query, queryOne } from '@/lib/db';
import { EventCheckRow } from '@/types/racing';
export async function POST(request: Request) {
try {
@@ -51,12 +52,14 @@ export async function POST(request: Request) {
}
// Check if event exists and is open
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
FROM events WHERE event_id = $1`,
[eventId]
const eventCheck = await queryOne<EventCheckRow>(
`SELECT event_id, event_status, max_participants,
(SELECT COUNT(*) FROM event_registrations
WHERE event_id = $1 AND status = 'REGISTERED') as current_registrations
FROM events WHERE event_id = $1`,
[eventId]
);
if (!eventCheck) {