import { deleteFile, getDiskFile, updateFile } from '../../../../../lib/disk.js';
export const dynamic='force-dynamic'; export const runtime='nodejs';
export async function GET(_r,{params}){ const {id}=await params; const file=getDiskFile(id); return file?Response.json({file}):Response.json({error:'not found'},{status:404}); }
export async function PATCH(request,{params}){ const {id}=await params; return Response.json({file:updateFile(id, await request.json())}); }
export async function DELETE(_r,{params}){ const {id}=await params; return Response.json({deleted:deleteFile(id)}); }
