import { fetchStoryPage } from "@/utils/strapi";
import { NextResponse } from "next/server";

export const dynamic = "force-dynamic";

export async function GET() {
  const data = await fetchStoryPage();
  return NextResponse.json({
    hasData: !!data,
    heroDesktopUrl: data?.heroBackgroundImageDesktop?.url ?? null,
    heroMobileUrl: data?.heroBackgroundImageMobile?.url ?? null,
    narrativeTitle: data?.narrative?.title ?? null,
    narrativeBlockCount: data?.narrative?.blocks?.length ?? 0,
  });
}
