"use strict";(()=>{var e={};e.id=8256,e.ids=[8256],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")},36968:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>k,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>c,staticGenerationAsyncStorage:()=>d});var o={};r.r(o),r.d(o,{POST:()=>m});var n=r(49303),a=r(88716),i=r(60670),s=r(87070),u=r(72331);async function m(e){try{let{commentId:t,userId:r}=await e.json();if(!t||!r)return s.NextResponse.json({error:"Missing commentId or userId"},{status:400});let o=await u._.commentLike.findUnique({where:{userId_commentId:{userId:r,commentId:t}}}),n=!1;o?(await u._.commentLike.delete({where:{id:o.id}}),n=!1):(await u._.commentLike.create({data:{userId:r,commentId:t}}),n=!0);let a=await u._.commentLike.count({where:{commentId:t}});return s.NextResponse.json({isLiked:n,count:a})}catch(e){return console.error("Failed to toggle like",e),s.NextResponse.json({error:"Internal Server Error"},{status:500})}}let p=new n.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/comments/like/route",pathname:"/api/comments/like",filename:"route",bundlePath:"app/api/comments/like/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\comments\\like\\route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:d,serverHooks:c}=p,k="/api/comments/like/route";function x(){return(0,i.patchFetch)({serverHooks:c,staticGenerationAsyncStorage:d})}},72331:(e,t,r)=>{r.d(t,{_:()=>n});var o=r(53524);let n=global.prisma||new o.PrismaClient}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[8948,5972],()=>r(36968));module.exports=o})();