import { NextResponse } from "next/server";

export async function GET(req) {
  const { query } = req.body;
  //const secretKey = process.env.RECAPTCHA_SECRET;

  const response = await fetch(
   // `${process.env.API_URL}searc/product?title=${query}&response=${recaptchaResponse}`,
    `${process.env.API_URL}search/product?title=${query}`,
    );
  const data = await response.json();

  if (data.success) {
    return NextResponse.json(data);
  } else {
    return NextResponse.json({err:err.mesage});
  }
}
