feat: scaffold rednote content projects
This commit is contained in:
@@ -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); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user