import logIP from "@/app/www/media/logIP";
import { getLatestEssays } from "@/app/www/logic/essay";

export const GET = logIP(async (req) => {
  const language = req.nextUrl.searchParams.get("language");
  if (!language) {
    return new Response(undefined, { status: 400 });
  }

  return Response.json(await getLatestEssays(language));
});
