locale upgrade
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user