"use strict";(()=>{var e={};e.id=9776,e.ids=[9776],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")},99507:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>h,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>c,serverHooks:()=>m,staticGenerationAsyncStorage:()=>v});var r={};a.r(r),a.d(r,{GET:()=>u,dynamic:()=>p});var n=a(49303),s=a(88716),o=a(60670),i=a(13538),d=a(87070);let p="force-dynamic";async function u(){try{let e=await i.Z.leave.findMany({include:{student:!0,teacher:!0},orderBy:{createdAt:"desc"}});return d.NextResponse.json({leaves:e})}catch(e){return console.error("Failed to fetch leaves:",e),d.NextResponse.json({leaves:[]},{status:500})}}let c=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/v1/attendance/leaves/route",pathname:"/api/v1/attendance/leaves",filename:"route",bundlePath:"app/api/v1/attendance/leaves/route"},resolvedPagePath:"C:\\School Management System\\Working\\V2\\src\\app\\api\\v1\\attendance\\leaves\\route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:l,staticGenerationAsyncStorage:v,serverHooks:m}=c,h="/api/v1/attendance/leaves/route";function x(){return(0,o.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:v})}},49303:(e,t,a)=>{e.exports=a(30517)},13538:(e,t,a)=>{a.d(t,{Z:()=>n});var r=a(53524);let n=globalThis.prisma??new r.PrismaClient({log:["error"],datasources:{db:{url:process.env.DATABASE_URL}}})}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,7070],()=>a(99507));module.exports=r})();