"use strict";(()=>{var e={};e.id=7134,e.ids=[7134],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},67447:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>x,patchFetch:()=>h,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>c,staticGenerationAsyncStorage:()=>m});var a={};t.r(a),t.d(a,{GET:()=>p});var s=t(49303),o=t(88716),n=t(60670),i=t(87070),u=t(72331);async function p(e){let{searchParams:r}=new URL(e.url),t=r.get("id");if(!t)return i.NextResponse.json({error:"Missing id"},{status:400});try{let[e,r]=await Promise.all([u._.favorite.count({where:{dramaId:t}}),u._.comment.count({where:{dramaId:t}})]);return i.NextResponse.json({totalLikes:e,totalComments:r})}catch(e){return console.error("Failed to fetch stats",e),i.NextResponse.json({error:"Internal Server Error"},{status:500})}}let d=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/drama/stats/route",pathname:"/api/drama/stats",filename:"route",bundlePath:"app/api/drama/stats/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\drama\\stats\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:c}=d,x="/api/drama/stats/route";function h(){return(0,n.patchFetch)({serverHooks:c,staticGenerationAsyncStorage:m})}},72331:(e,r,t)=>{t.d(r,{_:()=>s});var a=t(53524);let s=global.prisma||new a.PrismaClient}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[8948,5972],()=>t(67447));module.exports=a})();