(()=>{var e={};e.id=7124,e.ids=[7124],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12909:(e,r,t)=>{"use strict";function s(){let e=process.env.JWT_SECRET;if(!e)throw Error("JWT_SECRET is not set");return e}function i(e){let r=e.headers.get("authorization");if(r&&r.startsWith("Bearer "))return r.slice(7);let t=e.cookies.get("admin_token")?.value;if(t)return t;let s=e.cookies.get("token")?.value;return s||null}t.d(r,{V:()=>i,u:()=>s})},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:e=>{"use strict";e.exports=require("crypto")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79428:e=>{"use strict";e.exports=require("buffer")},91545:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>w,routeModule:()=>f,serverHooks:()=>g,workAsyncStorage:()=>h,workUnitAsyncStorage:()=>y});var s={};t.r(s),t.d(s,{PUT:()=>v});var i=t(96559),a=t(48088),n=t(37719),o=t(32190),u=t(43205),p=t.n(u),d=t(96330),c=t(12909);let l=new d.PrismaClient,m=(0,c.u)();async function x(e){let r=(0,c.V)(e);if(!r)return null;try{let e=p().verify(r,m);if(e.isGlobalAdmin&&e.globalAdminId)return e}catch{}return null}async function v(e,{params:r}){try{if(!await x(e))return o.NextResponse.json({error:"Unauthorized"},{status:401});let t=await Promise.resolve(r),s=parseInt(t.id),i=parseInt(t.userId);if(isNaN(s)||isNaN(i))return o.NextResponse.json({error:"Invalid company ID or user ID"},{status:400});let{isActive:a}=await e.json();if("boolean"!=typeof a)return o.NextResponse.json({error:"isActive must be a boolean"},{status:400});if(!await l.user.findFirst({where:{id:i,companyId:s}}))return o.NextResponse.json({error:"User not found or does not belong to this company"},{status:404});let n=await l.user.update({where:{id:i},data:{isActive:a}});return o.NextResponse.json({message:"User active status updated successfully",user:n})}catch(e){return console.error("Update user active status error:",e),o.NextResponse.json({error:"Server error",details:void 0},{status:500})}}let f=new i.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/admin/companies/[id]/users/[userId]/active/route",pathname:"/api/admin/companies/[id]/users/[userId]/active",filename:"route",bundlePath:"app/api/admin/companies/[id]/users/[userId]/active/route"},resolvedPagePath:"/Users/mustafaseyhan/Project/PazarAnalist/src/app/api/admin/companies/[id]/users/[userId]/active/route.ts",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:h,workUnitAsyncStorage:y,serverHooks:g}=f;function w(){return(0,n.patchFetch)({workAsyncStorage:h,workUnitAsyncStorage:y})}},96330:e=>{"use strict";e.exports=require("@prisma/client")},96487:()=>{}};var r=require("../../../../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[4447,580,3205],()=>t(91545));module.exports=s})();