import { createFolder, listFolders } from '../../../../lib/disk.js';
export const dynamic='force-dynamic'; export const runtime='nodejs';
export async function GET(request){ const url=new URL(request.url); return Response.json({ folders:listFolders(url.searchParams.get('project_id')) }); }
export async function POST(request){ try{ const b=await request.json(); return Response.json({ folder:createFolder(b.project_id,b.parent_id,b.name) },{status:201}); }catch(e){ return Response.json({error:e.message},{status:400}); } }
