"use strict";(()=>{var e={};e.id=7429,e.ids=[7429],e.modules={53524:e=>{e.exports=require("@prisma/client")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},17525:(e,r,t)=>{t.r(r),t.d(r,{headerHooks:()=>P,originalPathname:()=>E,requestAsyncStorage:()=>l,routeModule:()=>c,serverHooks:()=>m,staticGenerationAsyncStorage:()=>p,staticGenerationBailout:()=>A});var o={};t.r(o),t.d(o,{DELETE:()=>i}),t(95655);var s=t(83323),a=t(54647),u=t(66886),n=t(30953);async function i(e,{params:r}){try{let{id:e}=r,t=await n._.customer.findUnique({where:{id:e},include:{_count:{select:{orders:!0}}}});if(!t)return u.Z.json({error:"Customer not found"},{status:404});await n._.order.updateMany({where:{customerId:e},data:{customerId:null}});let o=await n._.customer.delete({where:{id:e}});return u.Z.json(o)}catch(e){return console.error("Error deleting customer:",e),u.Z.json({error:"Error deleting customer"},{status:500})}}let d=s.AppRouteRouteModule,c=new d({definition:{kind:a.x.APP_ROUTE,page:"/api/customers/[id]/route",pathname:"/api/customers/[id]",filename:"route",bundlePath:"app/api/customers/[id]/route"},resolvedPagePath:"D:\\Code\\MusaFoods_New\\musafoods\\app\\api\\customers\\[id]\\route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:p,serverHooks:m,headerHooks:P,staticGenerationBailout:A}=c,E="/api/customers/[id]/route"},30953:(e,r,t)=>{t.d(r,{_:()=>a});var o=t(53524);let s=globalThis,a=s.prisma??new o.PrismaClient},54647:(e,r)=>{var t;Object.defineProperty(r,"x",{enumerable:!0,get:function(){return t}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(t||(t={}))}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),o=r.X(0,[9727,3497,6886],()=>t(17525));module.exports=o})();