import { NextResponse } from 'next/server';
import {bd} from "@/lib/bd";

export async function GET(req: Request) {
    const { searchParams } = new URL(req.url);
    const gameType = searchParams.get('gameType');
    const roomType = searchParams.get('roomType');

    const [rows] = await bd.execute(
        'SELECT day_type, hour_1, hour_3, hour_5, night FROM prices WHERE game_type = ? AND room_type = ?',
        [gameType, roomType]
    );

    return NextResponse.json(rows);
}
