(()=>{var e={};e.id=960,e.ids=[960],e.modules={96330:e=>{"use strict";e.exports=require("@prisma/client")},5486:e=>{"use strict";e.exports=require("bcrypt")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},12412:e=>{"use strict";e.exports=require("assert")},79428:e=>{"use strict";e.exports=require("buffer")},55511:e=>{"use strict";e.exports=require("crypto")},94735:e=>{"use strict";e.exports=require("events")},81630:e=>{"use strict";e.exports=require("http")},55591:e=>{"use strict";e.exports=require("https")},11723:e=>{"use strict";e.exports=require("querystring")},79551:e=>{"use strict";e.exports=require("url")},28354:e=>{"use strict";e.exports=require("util")},74075:e=>{"use strict";e.exports=require("zlib")},41158:(e,r,s)=>{"use strict";s.r(r),s.d(r,{patchFetch:()=>q,routeModule:()=>m,serverHooks:()=>g,workAsyncStorage:()=>x,workUnitAsyncStorage:()=>w});var t={};s.r(t),s.d(t,{DELETE:()=>l,GET:()=>c});var i=s(42706),a=s(28203),n=s(45994),o=s(39187),u=s(64767),d=s(34883),p=s(11587);async function c(e,{params:r}){if(!await (0,u.getServerSession)(d.N))return o.NextResponse.json({error:"N\xe3o autorizado. Fa\xe7a login primeiro."},{status:401});try{let e=(await r).id,s=await p.A.admin.findUnique({where:{id:Number(e)}});if(!s)return o.NextResponse.json({error:"Admin n\xe3o encontrado"},{status:404});return o.NextResponse.json(s)}catch(e){return o.NextResponse.json({error:e.message},{status:500})}}async function l(e,{params:r}){if(!await (0,u.getServerSession)(d.N))return o.NextResponse.json({error:"N\xe3o autorizado. Fa\xe7a login primeiro."},{status:401});try{let e=(await r).id,s=Number(e);return await p.A.admin.delete({where:{id:s}}),o.NextResponse.json({message:"Admin deletado com sucesso"})}catch(e){return console.error(e),o.NextResponse.json({error:"Erro ao deletar o admin."},{status:500})}}let m=new i.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/admin/admins/[id]/route",pathname:"/api/admin/admins/[id]",filename:"route",bundlePath:"app/api/admin/admins/[id]/route"},resolvedPagePath:"C:\\Users\\guilh\\Desktop\\plataforma-empregos-NextJs-Ts\\app\\api\\admin\\admins\\[id]\\route.ts",nextConfigOutput:"",userland:t}),{workAsyncStorage:x,workUnitAsyncStorage:w,serverHooks:g}=m;function q(){return(0,n.patchFetch)({workAsyncStorage:x,workUnitAsyncStorage:w})}},96487:()=>{},78335:()=>{},34883:(e,r,s)=>{"use strict";s.d(r,{N:()=>o});var t=s(96330),i=s(91642),a=s(5486);let n=new t.PrismaClient,o={providers:[(0,i.A)({name:"Credentials",credentials:{email:{label:"Email",type:"email"},password:{label:"Password",type:"password"}},async authorize(e){if(!e?.email||!e?.password)throw Error("Credenciais inv\xe1lidas.");let r=await n.admin.findUnique({where:{email:e.email}});if(!r||!await (0,a.compare)(e.password,r.password))throw Error("Credenciais inv\xe1lidas.");return{id:r.id.toString(),username:r.username,email:r.email}}})],callbacks:{jwt:async({token:e,user:r})=>(r&&(e.id=r.id,e.username=r.name,e.email=r.email),e),session:async({session:e,token:r})=>(r&&(e.user={email:r.email}),e)},pages:{signIn:"/admin/login"},secret:process.env.NEXTAUTH_SECRET,session:{strategy:"jwt"}}},11587:(e,r,s)=>{"use strict";s.d(r,{A:()=>t});let t=new(s(96330)).PrismaClient}};var r=require("../../../../../webpack-runtime.js");r.C(e);var s=e=>r(r.s=e),t=r.X(0,[638,452,331],()=>s(41158));module.exports=t})();