locale upgrade

This commit is contained in:
2026-01-22 20:56:35 +01:00
parent 377631ee50
commit 37a1bc4e18
28 changed files with 2117 additions and 71 deletions

View File

@@ -42,11 +42,13 @@ export async function PUT(
locale?: string;
title?: string;
description?: string;
content?: string;
};
const locale = body.locale || "en";
const title = body.title?.trim();
const description = body.description?.trim();
const content = typeof body.content === "string" ? body.content.trim() : undefined;
if (!title || !description) {
return NextResponse.json({ error: "title and description are required" }, { status: 400 });
@@ -59,10 +61,12 @@ export async function PUT(
locale,
title,
description,
content: content ?? null,
},
update: {
title,
description,
content: content ?? null,
},
});