first commit
This commit is contained in:
24
app/api/asc/screenshots/commit/route.ts
Normal file
24
app/api/asc/screenshots/commit/route.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { appleApiRequest } from "@/app/asc/api";
|
||||
|
||||
// PATCH /api/asc/screenshots/commit { screenshotId, md5, ... }
|
||||
// Step 3: Commit the uploaded screenshot to mark upload as complete
|
||||
export async function PATCH(req: NextRequest) {
|
||||
const body = await req.json();
|
||||
const { screenshotId } = body ?? {};
|
||||
if (!screenshotId) return NextResponse.json({ error: "screenshotId gerekli" }, { status: 400 });
|
||||
|
||||
const result = await appleApiRequest(`/appScreenshots/${screenshotId}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
data: {
|
||||
type: "appScreenshots",
|
||||
id: screenshotId,
|
||||
attributes: { uploaded: true },
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
if (result.error) return NextResponse.json({ error: result.error }, { status: 502 });
|
||||
return NextResponse.json(result.data);
|
||||
}
|
||||
Reference in New Issue
Block a user