import { NextResponse } from "next/server";

import prismadb from "@/lib/prisma";

export async function GET(
  req: Request,
  { params }: { params: { storeId: string, contentPageTitle: string } }
) {
  try {

    const country = await prismadb.contentPage.findFirst({
      where: {
        title: params.contentPageTitle
      }
    });

    return NextResponse.json(country);

  } catch (error) {
    console.log('[CONTENTPAGETITLE_GET]', error);
    return new NextResponse("Internal error", { status: 500 })
  }
};