"use strict";(()=>{var e={};e.id=6210,e.ids=[6210,2331],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")},34706:(e,s,i)=>{i.r(s),i.d(s,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>c,routeModule:()=>m,serverHooks:()=>v,staticGenerationAsyncStorage:()=>l});var r={};i.r(r),i.d(r,{DELETE:()=>p,PATCH:()=>d});var t=i(49303),a=i(88716),n=i(60670),o=i(87070),u=i(72331);async function d(e,{params:s}){try{let{title:i,description:r,type:t,category:a,reward_coins:n,requirement_type:d,requirement_value:p,is_premium_only:m,is_active:c}=await e.json(),l={};void 0!==i&&(l.title=i),void 0!==r&&(l.description=r),void 0!==t&&(l.type=t),void 0!==a&&(l.category=a),void 0!==n&&(l.rewardCoins=Number(n)),void 0!==d&&(l.requirementType=d),void 0!==p&&(l.requirementValue=p?Number(p):null),void 0!==m&&(l.isPremiumOnly=m),void 0!==c&&(l.isActive=c);let v=parseInt(s.id,10);if(isNaN(v))return o.NextResponse.json({success:!1,message:"ID misi tidak valid"},{status:400});return await u.prisma.mission.update({where:{id:v},data:l}),o.NextResponse.json({success:!0,message:"Misi diperbarui"})}catch(e){return console.error("Mission PATCH error:",e),o.NextResponse.json({success:!1,message:"Gagal memperbarui misi"},{status:500})}}async function p(e,{params:s}){try{let e=parseInt(s.id,10);if(isNaN(e))return o.NextResponse.json({success:!1,message:"ID misi tidak valid"},{status:400});return await u.prisma.mission.delete({where:{id:e}}),o.NextResponse.json({success:!0,message:"Misi dihapus"})}catch(e){return console.error("Mission DELETE error:",e),o.NextResponse.json({success:!1,message:"Gagal menghapus misi"},{status:500})}}let m=new t.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/admin/missions/[id]/route",pathname:"/api/admin/missions/[id]",filename:"route",bundlePath:"app/api/admin/missions/[id]/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\missions\\[id]\\route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:c,staticGenerationAsyncStorage:l,serverHooks:v}=m,g="/api/admin/missions/[id]/route";function x(){return(0,n.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:l})}},72331:(e,s,i)=>{i.d(s,{prisma:()=>t});var r=i(53524);let t=globalThis.prisma??new r.PrismaClient({log:["error"]})}};var s=require("../../../../../webpack-runtime.js");s.C(e);var i=e=>s(s.s=e),r=s.X(0,[9276,5972],()=>i(34706));module.exports=r})();