fix a functional bug

This commit is contained in:
Erza Bytyci
2026-07-19 15:10:29 +00:00
parent f46d976a62
commit 796dd873a5
@@ -107,7 +107,18 @@ export const PUT = withAuth(
try {
newData = await getPageData(type, slug);
} catch {
return new NextResponse("not found", { status: 404 });
if (type !== "grammar") {
return new NextResponse("not found", { status: 404 });
}
newData = {
title: "",
description: null,
content: "",
page_order: null,
slug,
page_group: type,
};
}
if (data.title) newData.title = data.title;
if (data.page_order) newData.page_order = data.page_order;