feat: scaffold rednote content projects

This commit is contained in:
2026-10-04 20:06:21 +08:00
parent 46c4d06db7
commit 0690ecf050
13 changed files with 327 additions and 220 deletions
+9 -2
View File
@@ -1,6 +1,6 @@
import { NextResponse } from "next/server";
import { NextRequest, NextResponse } from "next/server";
import { errorResponse } from "../../../../lib/http";
import { getProject, listFiles } from "../../../../lib/storage";
import { getProject, listFiles, updateProject } from "../../../../lib/storage";
export const runtime = "nodejs";
@@ -11,3 +11,10 @@ export async function GET(_: Request, context: { params: Promise<{ id: string }>
return NextResponse.json({ project, files });
} catch (error) { return errorResponse(error); }
}
export async function PUT(request: NextRequest, context: { params: Promise<{ id: string }> }) {
try {
const { id } = await context.params;
return NextResponse.json({ project: await updateProject(id, await request.json()) });
} catch (error) { return errorResponse(error); }
}