import { NextResponse } from "next/server";
import pool from "../../../../lib/db/db"; // adjust if needed

export async function GET() {

  const [result] = await pool.query(`
    SELECT
      source_path,
      destination_path,
      redirect_type
    FROM redirects
    WHERE is_active = 1
  `);

  return NextResponse.json(
    {
      success: true,
      message: "Redirects fetched successfully",
      data: result
    },
    {
      status: 200
    }

  );
}
